@@ -179,6 +179,10 @@ endif
# add -include rte_config to cflags
add_project_arguments('-include', 'rte_config.h', language: 'c')
+if get_option('rte_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
@@ -9,3 +9,4 @@ drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec']
config_flag_fmt = 'RTE_LIBRTE_PMD_BBDEV_@0@'
driver_name_fmt = 'rte_pmd_bbdev_@0@'
+rte_debug_fmt = 'RTE_DEBUG_BASEBAND_@0@'
@@ -5,3 +5,4 @@ drivers = ['dpaa', 'fslmc', 'ifpga', 'pci', 'vdev', 'vmbus']
std_deps = ['eal']
config_flag_fmt = 'RTE_LIBRTE_@0@_BUS'
driver_name_fmt = 'rte_bus_@0@'
+rte_debug_fmt = 'RTE_DEBUG_BUS_@0@'
@@ -9,3 +9,4 @@ std_deps = ['eal']
drivers = ['cpt', 'dpaax', 'iavf', 'mlx5', 'mvep', 'octeontx', 'octeontx2', 'qat']
config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON'
driver_name_fmt = 'rte_common_@0@'
+rte_debug_fmt = 'RTE_DEBUG_COMMON_@0@'
@@ -10,3 +10,4 @@ drivers = ['isal', 'octeontx', 'qat', 'zlib']
std_deps = ['compressdev'] # compressdev pulls in all other needed deps
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'
+rte_debug_fmt = 'RTE_DEBUG_COMPRESS_@0@'
@@ -28,3 +28,4 @@ drivers = ['aesni_gcm',
std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'
+rte_debug_fmt = 'RTE_DEBUG_CRYPTO_@0@'
@@ -13,3 +13,4 @@ endif
std_deps = ['eventdev', 'kvargs']
config_flag_fmt = 'RTE_LIBRTE_@0@_EVENTDEV_PMD'
driver_name_fmt = 'rte_pmd_@0@_event'
+rte_debug_fmt = 'RTE_DEBUG_EVENT_@0@'
@@ -9,3 +9,4 @@ drivers = ['bucket', 'dpaa', 'dpaa2', 'octeontx', 'octeontx2', 'ring', 'stack']
std_deps = ['mempool']
config_flag_fmt = 'RTE_LIBRTE_@0@_MEMPOOL'
driver_name_fmt = 'rte_mempool_@0@'
+rte_debug_fmt = 'RTE_DEBUG_MEMPOOL_@0@'
@@ -99,6 +99,9 @@ foreach class:dpdk_driver_classes
fmt_name = name
endif
dpdk_conf.set(config_flag_fmt.format(fmt_name.to_upper()),1)
+ if get_option('rte_debug')
+ dpdk_conf.set(rte_debug_fmt.format(fmt_name.to_upper()),1)
+ endif
lib_name = driver_name_fmt.format(fmt_name)
dpdk_extra_ldflags += pkgconfig_extra_libs
@@ -60,3 +60,4 @@ std_deps += ['bus_pci'] # very many PMDs depend on PCI, so make std
std_deps += ['bus_vdev'] # same with vdev bus
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'
+rte_debug_fmt = 'RTE_DEBUG_NET_@0@'
@@ -13,3 +13,4 @@ drivers = ['dpaa2_cmdif', 'dpaa2_qdma',
std_deps = ['rawdev']
config_flag_fmt = 'RTE_LIBRTE_PMD_@0@_RAWDEV'
driver_name_fmt = 'rte_rawdev_@0@'
+rte_debug_fmt = 'RTE_DEBUG_RAW_@0@'
@@ -11,3 +11,4 @@ std_deps = ['bus_pci', 'kvargs']
std_deps += ['vhost']
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'
+rte_debug_fmt = 'RTE_DEBUG_VDPA_@0@'
@@ -99,6 +99,10 @@ foreach l:libraries
dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
install_headers(headers)
+ if get_option('rte_debug')
+ dpdk_conf.set('RTE_DEBUG_' + name.to_upper(), 1)
+ endif
+
libname = 'rte_' + name
includes += include_directories(dir_name)
@@ -32,6 +32,8 @@ option('max_numa_nodes', type: 'integer', value: 4,
description: 'maximum number of NUMA nodes supported by EAL')
option('enable_trace_fp', type: 'boolean', value: false,
description: 'enable fast path trace points.')
+option('rte_debug', type: 'boolean', value: false,
+ description: 'build with additional sanity checks, validations and logs')
option('tests', type: 'boolean', value: true,
description: 'build unit tests')
option('use_hpet', type: 'boolean', value: false,
A new boolean meson build flag is introduced with this patch: rte_debug. To enable this option add -Drte_debug=true to the meson configure command. 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. Additionally for all enabled to be built libraries a RTE_DEBUG_{library name} is defined and assigned a value 1. This standardize names of library specific debug macros. Those can be used also without rte_debug option by using CFLAGS="-D..." build parameter. Code put inside RTE_DEBUG* #ifdef sections should be also put inside if (rte_log_can_log(...)) condition to allow run-time filtering of sanity checks, validations, logs and dumps when using rte_debug option. Libraries will be adjusted to the change in separate patches. Similarly for all enabled to be built drivers a RTE_DEBUG_{driver_class}_{driver_name} is defined and assigned value 1. Suggested-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> --- config/meson.build | 4 ++++ drivers/baseband/meson.build | 1 + drivers/bus/meson.build | 1 + drivers/common/meson.build | 1 + drivers/compress/meson.build | 1 + drivers/crypto/meson.build | 1 + drivers/event/meson.build | 1 + drivers/mempool/meson.build | 1 + drivers/meson.build | 3 +++ drivers/net/meson.build | 1 + drivers/raw/meson.build | 1 + drivers/vdpa/meson.build | 1 + lib/meson.build | 4 ++++ meson_options.txt | 2 ++ 14 files changed, 23 insertions(+)