Use global debug flag RTE_DEBUG instead of RTE_MALLOC_DEBUG.
The old define is completely removed from source code and config.
Tests and documentation were also updated.
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
app/test/test_malloc.c | 4 ++--
config/common_base | 1 -
doc/guides/prog_guide/env_abstraction_layer.rst | 5 +++--
lib/librte_eal/common/malloc_elem.c | 2 +-
lib/librte_eal/common/malloc_elem.h | 4 ++--
lib/librte_eal/common/rte_malloc.c | 2 +-
6 files changed, 9 insertions(+), 9 deletions(-)
@@ -641,7 +641,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_MALLOC_DEBUG
+#ifdef RTE_DEBUG
int retval;
char *over_write_vals = NULL;
#endif
@@ -663,7 +663,7 @@ test_rte_malloc_validate(void)
if (allocated_size < request_size)
err_return();
-#ifdef RTE_MALLOC_DEBUG
+#ifdef RTE_DEBUG
/****** change the header to be bad */
char save_buf[64];
@@ -107,7 +107,6 @@ CONFIG_RTE_EAL_IGB_UIO=n
CONFIG_RTE_EAL_VFIO=n
CONFIG_RTE_MAX_VFIO_GROUPS=64
CONFIG_RTE_MAX_VFIO_CONTAINERS=64
-CONFIG_RTE_MALLOC_DEBUG=n
CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n
CONFIG_RTE_USE_LIBBSD=n
# Use WFE instructions to implement the rte_wait_for_equal_xxx APIs,
@@ -714,8 +714,9 @@ manual for more information.
Cookies
~~~~~~~
-When CONFIG_RTE_MALLOC_DEBUG is enabled, the allocated memory contains
-overwrite protection fields to help identify buffer overflows.
+When RTE_DEBUG is enabled (e.g. by enabling "debug" option in meson setup,
+the allocated memory contains overwrite protection fields to help identify
+buffer overflows.
Alignment and NUMA Constraints
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -28,7 +28,7 @@
* to catch buggy programs. Otherwise, freed memory is set to zero
* to avoid having to zero in zmalloc
*/
-#ifdef RTE_MALLOC_DEBUG
+#ifdef RTE_DEBUG
#define MALLOC_POISON 0x6b
#else
#define MALLOC_POISON 0
@@ -32,13 +32,13 @@ struct malloc_elem {
size_t size;
struct malloc_elem *orig_elem;
size_t orig_size;
-#ifdef RTE_MALLOC_DEBUG
+#ifdef RTE_DEBUG
uint64_t header_cookie; /* Cookie marking start of data */
/* trailer cookie at start + size */
#endif
} __rte_cache_aligned;
-#ifndef RTE_MALLOC_DEBUG
+#ifndef RTE_DEBUG
static const unsigned MALLOC_ELEM_TRAILER_LEN = 0;
/* dummy function - just check if pointer is non-null */
@@ -78,7 +78,7 @@ rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
{
void *ptr = rte_malloc_socket(type, size, align, socket);
-#ifdef RTE_MALLOC_DEBUG
+#ifdef RTE_DEBUG
/*
* If DEBUG is enabled, then freed memory is marked with poison
* value and set to zero on allocation.