log: do not drop debug logs at compile time
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 23 Nov 2016 15:34:25 +0000 (16:34 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 1 Dec 2016 17:09:13 +0000 (18:09 +0100)
commit5d8f0baf69ea1462c8cc32729c789f7278bf3dc2
treef5fb976fb34d93df38da0e727ceba2ff8e5c960e
parent112fc39b829039ee4ade210c464d26fecde7eac0
log: do not drop debug logs at compile time

Today, all logs whose level is lower than INFO are dropped at
compile-time. This prevents from enabling debug logs at runtime using
--log-level=8.

The rationale was to remove debug logs from the data path at
compile-time, avoiding a test at run-time.

This patch changes the behavior of RTE_LOG() to avoid the compile-time
optimization, and introduces the RTE_LOG_DP() macro that has the same
behavior than the previous RTE_LOG(), for the rare cases where debug
logs are in the data path.

So it is now possible to enable debug logs at run-time by just
specifying --log-level=8. Some drivers still have special compile-time
options to enable more debug log. Maintainers may consider to
remove/reduce them.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 files changed:
config/common_base
doc/guides/faq/faq.rst
drivers/net/bnxt/bnxt_txr.c
drivers/net/nfp/nfp_net.c
examples/distributor/main.c
examples/ipsec-secgw/esp.c
examples/ipsec-secgw/ipsec.c
examples/packet_ordering/main.c
examples/quota_watermark/qw/main.c
examples/tep_termination/main.c
examples/vhost/main.c
examples/vhost_xen/main.c
lib/librte_eal/common/include/rte_log.h