DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Matan Azrad <matan@nvidia.com>, Shahaf Shuler <shahafs@nvidia.com>
Subject: [dpdk-dev] [PATCH 1/3] net/mlx4: enable debug logs dynamically
Date: Mon,  8 Mar 2021 23:28:53 +0100	[thread overview]
Message-ID: <20210308222855.823670-2-thomas@monjalon.net> (raw)
In-Reply-To: <20210308222855.823670-1-thomas@monjalon.net>

The macro DEBUG was doing nothing if not compiled with
RTE_LIBRTE_MLX4_DEBUG.

As it is not used in the data path, it can be always enabled at
compilation time. Then it can be enabled at runtime with:
	--log-level pmd.net.mlx4:debug

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx4/mlx4_utils.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
index b8769562ab..fca21fd79c 100644
--- a/drivers/net/mlx4/mlx4_utils.h
+++ b/drivers/net/mlx4/mlx4_utils.h
@@ -52,14 +52,13 @@ pmd_drv_log_basename(const char *s)
 			__LINE__, \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define MLX4_ASSERT(exp) RTE_VERIFY(exp)
 #define claim_zero(...) MLX4_ASSERT((__VA_ARGS__) == 0)
 
 #else /* RTE_LIBRTE_MLX4_DEBUG */
 
 /*
- * Like MLX4_ASSERT(), DEBUG() becomes a no-op and claim_zero() does not perform
+ * Like MLX4_ASSERT(), claim_zero() does not perform
  * any check when debugging is disabled.
  */
 
@@ -68,12 +67,12 @@ pmd_drv_log_basename(const char *s)
 		RTE_FMT(MLX4_DRIVER_NAME ": " \
 			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
-#define DEBUG(...) (void)0
 #define MLX4_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
 
 #endif /* RTE_LIBRTE_MLX4_DEBUG */
 
+#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__)
 #define INFO(...) PMD_DRV_LOG(INFO, __VA_ARGS__)
 #define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__)
 #define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__)
-- 
2.30.1


  reply	other threads:[~2021-03-08 22:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 22:28 [dpdk-dev] [PATCH 0/3] adjust mlx debug logs Thomas Monjalon
2021-03-08 22:28 ` Thomas Monjalon [this message]
2021-03-08 22:28 ` [dpdk-dev] [PATCH 2/3] common/mlx5: enable debug logs dynamically Thomas Monjalon
2021-03-08 22:28 ` [dpdk-dev] [PATCH 3/3] net/mlx5: reduce log level of alignment message Thomas Monjalon
2021-03-09  9:48 ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Thomas Monjalon
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/mlx4: enable debug logs dynamically Thomas Monjalon
2021-03-11 20:03     ` Matan Azrad
2021-03-17 17:29     ` Ferruh Yigit
2021-03-17 17:47       ` Thomas Monjalon
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 2/4] common/mlx5: " Thomas Monjalon
2021-03-11 20:04     ` Matan Azrad
2021-03-17 17:39     ` Ferruh Yigit
2021-03-17 17:48       ` Thomas Monjalon
2021-03-18 10:13         ` Matan Azrad
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 3/4] common/mlx5: remove extra line feed in log messages Thomas Monjalon
2021-03-11 20:05     ` Matan Azrad
2021-03-09  9:48   ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: reduce log level of alignment message Thomas Monjalon
2021-03-11 20:07     ` Matan Azrad
2021-03-16  9:04   ` [dpdk-dev] [PATCH v2 0/4] adjust mlx debug logs Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210308222855.823670-2-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=shahafs@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).