From patchwork Sat Sep 9 07:33:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xueming Li X-Patchwork-Id: 28526 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99AD91AEFF; Sat, 9 Sep 2017 09:33:39 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id F2D361AEF9 for ; Sat, 9 Sep 2017 09:33:36 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Sep 2017 10:33:31 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v897XU3r003715; Sat, 9 Sep 2017 10:33:31 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id v897XTDk073218; Sat, 9 Sep 2017 15:33:29 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id v897XPre073216; Sat, 9 Sep 2017 15:33:25 +0800 From: Xueming Li To: Stephen Hemminger , Sergio Gonzalez Monroy Cc: dev@dpdk.org, Xueming Li Date: Sat, 9 Sep 2017 15:33:18 +0800 Message-Id: <20170909073319.73174-1-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170823022926.169272-1-xuemingl@mellanox.com> References: <20170823022926.169272-1-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v3 1/2] eal/malloc: fix RTE malloc debug macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch replaces broken macro RTE_LIBRTE_MALLOC_DEBUG with RTE_MALLOC_DEBUG. Fixes: af75078fece3 ("first public release") Cc: Sergio Gonzalez Monroy Signed-off-by: Xueming Li Acked-by: Sergio Gonzalez Monroy --- lib/librte_eal/common/malloc_elem.h | 4 ++-- test/test/test_malloc.c | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/common/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h index f04b2d1e4..ce39129d9 100644 --- a/lib/librte_eal/common/malloc_elem.h +++ b/lib/librte_eal/common/malloc_elem.h @@ -53,13 +53,13 @@ struct malloc_elem { volatile enum elem_state state; uint32_t pad; size_t size; -#ifdef RTE_LIBRTE_MALLOC_DEBUG +#ifdef RTE_MALLOC_DEBUG uint64_t header_cookie; /* Cookie marking start of data */ /* trailer cookie at start + size */ #endif } __rte_cache_aligned; -#ifndef RTE_LIBRTE_MALLOC_DEBUG +#ifndef RTE_MALLOC_DEBUG static const unsigned MALLOC_ELEM_TRAILER_LEN = 0; /* dummy function - just check if pointer is non-null */ diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c index 013fd4407..cee6469d8 100644 --- a/test/test/test_malloc.c +++ b/test/test/test_malloc.c @@ -108,8 +108,7 @@ test_align_overlap_per_lcore(__attribute__((unused)) void *arg) } for(j = 0; j < 1000 ; j++) { if( *(char *)p1 != 0) { - printf("rte_zmalloc didn't zero" - "the allocated memory\n"); + printf("rte_zmalloc didn't zero the allocated memory\n"); ret = -1; } } @@ -180,8 +179,7 @@ test_reordered_free_per_lcore(__attribute__((unused)) void *arg) } for(j = 0; j < 1000 ; j++) { if( *(char *)p1 != 0) { - printf("rte_zmalloc didn't zero" - "the allocated memory\n"); + printf("rte_zmalloc didn't zero the allocated memory\n"); ret = -1; } } @@ -293,7 +291,7 @@ test_multi_alloc_statistics(void) struct rte_malloc_socket_stats pre_stats, post_stats ,first_stats, second_stats; size_t size = 2048; int align = 1024; -#ifndef RTE_LIBRTE_MALLOC_DEBUG +#ifndef RTE_MALLOC_DEBUG int trailer_size = 0; #else int trailer_size = RTE_CACHE_LINE_SIZE; @@ -623,7 +621,7 @@ test_rte_malloc_validate(void) const size_t request_size = 1024; size_t allocated_size; char *data_ptr = rte_malloc(NULL, request_size, RTE_CACHE_LINE_SIZE); -#ifdef RTE_LIBRTE_MALLOC_DEBUG +#ifdef RTE_MALLOC_DEBUG int retval; char *over_write_vals = NULL; #endif @@ -645,7 +643,7 @@ test_rte_malloc_validate(void) if (allocated_size < request_size) err_return(); -#ifdef RTE_LIBRTE_MALLOC_DEBUG +#ifdef RTE_MALLOC_DEBUG /****** change the header to be bad */ char save_buf[64];