[v1,01/17] config: introduce global debug flag

Message ID 20200417215739.23180-2-l.wojciechow@partner.samsung.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series introduce global debug flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/Intel-compilation success Compilation OK

Commit Message

Lukasz Wojciechowski April 17, 2020, 9:57 p.m. UTC
  There already is a meson core option "debug". To enable this option
add -Ddebug=true to the meson command during setup or configuration
of the build environment.

By enabling this flag the globaly defined macro RTE_DEBUG becomes
defined. It should be used for enabling debug code in all dpdk project
components. Using this flag allows to make additional checks or tests
and provide additional logs even in performance sensitive parts of code.

The flag is disabled by default.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 config/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 58421342b..04909f922 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -176,6 +176,10 @@  endif
 # add -include rte_config to cflags
 add_project_arguments('-include', 'rte_config.h', language: 'c')
 
+if get_option('debug')
+	dpdk_conf.set('RTE_DEBUG', 1)
+endif
+
 # enable extra warnings and disable any unwanted warnings
 warning_flags = [
 	# -Wall is added by meson by default, so add -Wextra only