DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level
@ 2018-11-29 20:31 Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2018-11-29 20:31 UTC (permalink / raw)
  To: byron.marohn, pablo.de.lara.guarch, bruce.richardson, rsanford
  Cc: dev, Dharmik Thakkar

Currently, in test code, for printing extra information,
compilation time options are used. This approach does not compile the
code always. Macro needs to be set for the code to compile.

This patchset replaces compilation time option with log level based
approach, thus enabling compilation of code always. Log levels can be
set using eal parameters.

Dharmik Thakkar (3):
  test/hash: replace macro with log-level approach
  test/efd: enable unit test compilation always
  test/timer: enable unit test compilation always

 test/test/test_efd.c            | 24 ++++++++----------------
 test/test/test_hash.c           |  3 +--
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 3 files changed, 19 insertions(+), 31 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH 1/3] test/hash: replace macro with log-level approach
  2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
@ 2018-11-29 20:31 ` Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2018-11-29 20:31 UTC (permalink / raw)
  To: byron.marohn, pablo.de.lara.guarch, bruce.richardson, rsanford
  Cc: dev, Dharmik Thakkar

Need to set hash log type to debug to print debug information, using
following eal parameter: --log-type=hash,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 test/test/test_hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/test/test_hash.c b/test/test/test_hash.c
index fe607fadf262..67b8e54bdf13 100644
--- a/test/test/test_hash.c
+++ b/test/test/test_hash.c
@@ -80,14 +80,13 @@ static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
 	return 3;
 }
 
-#define UNIT_TEST_HASH_VERBOSE	0
 /*
  * Print out result of unit test hash operation.
  */
 static void print_key_info(const char *msg, const struct flow_key *key,
 								int32_t pos)
 {
-	if (UNIT_TEST_HASH_VERBOSE) {
+	if (rte_log_get_level(RTE_LOGTYPE_HASH) == RTE_LOG_DEBUG) {
 		const uint8_t *p = (const uint8_t *)key;
 		unsigned int i;
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH 2/3] test/efd: enable unit test compilation always
  2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
@ 2018-11-29 20:31 ` Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 3/3] test/timer: " Dharmik Thakkar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2018-11-29 20:31 UTC (permalink / raw)
  To: byron.marohn, pablo.de.lara.guarch, bruce.richardson, rsanford
  Cc: dev, Dharmik Thakkar

This patch enables compilation of print_key_info() always using
log-level based approach instead of a macro. Need to set efd log type
to debug to print debug information, using the following eal parameter:
--log-type=efd,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 test/test/test_efd.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index ced091aab63d..3b6f9db13565 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -34,28 +34,20 @@ struct flow_key {
 /*
  * Print out result of unit test efd operation.
  */
-#if defined(UNIT_TEST_EFD_VERBOSE)
-
 static void print_key_info(const char *msg, const struct flow_key *key,
 		efd_value_t val)
 {
-	const uint8_t *p = (const uint8_t *) key;
-	unsigned int i;
+	if (rte_log_get_level(RTE_LOGTYPE_EFD) == RTE_LOG_DEBUG) {
+		const uint8_t *p = (const uint8_t *) key;
+		unsigned int i;
 
-	printf("%s key:0x", msg);
-	for (i = 0; i < sizeof(struct flow_key); i++)
-		printf("%02X", p[i]);
-
-	printf(" @ val %d\n", val);
-}
-#else
+		printf("%s key:0x", msg);
+		for (i = 0; i < sizeof(struct flow_key); i++)
+			printf("%02X", p[i]);
 
-static void print_key_info(__attribute__((unused)) const char *msg,
-		__attribute__((unused)) const struct flow_key *key,
-		__attribute__((unused)) efd_value_t val)
-{
+		printf(" @ val %d\n", val);
+	}
 }
-#endif
 
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = {
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH 3/3] test/timer: enable unit test compilation always
  2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
@ 2018-11-29 20:31 ` Dharmik Thakkar
  2019-01-11 16:30 ` [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Ferruh Yigit
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2018-11-29 20:31 UTC (permalink / raw)
  To: byron.marohn, pablo.de.lara.guarch, bruce.richardson, rsanford
  Cc: dev, Dharmik Thakkar

This patch replaces macro with log-level based approach to print debug
information. Need to set timer log type to debug  using the following
eal parameter: --log-level=timer,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/test/test/test_timer_racecond.c b/test/test/test_timer_racecond.c
index d29048eaf1bf..5ac248b2d90b 100644
--- a/test/test/test_timer_racecond.c
+++ b/test/test/test_timer_racecond.c
@@ -44,8 +44,6 @@
 #include <rte_malloc.h>
 #include <rte_pause.h>
 
-#undef TEST_TIMER_RACECOND_VERBOSE
-
 #ifdef RTE_EXEC_ENV_LINUXAPP
 #define usec_delay(us) usleep(us)
 #else
@@ -70,13 +68,12 @@ timer_cb(struct rte_timer *tim, void *arg __rte_unused)
 {
 	/* Simulate slow callback function, 100 us. */
 	rte_delay_us(100);
-
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-	if (tim == &timer[0])
-		printf("------------------------------------------------\n");
-	printf("timer_cb: core %u timer %lu\n",
-		rte_lcore_id(), tim - timer);
-#endif
+	if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+		if (tim == &timer[0])
+			printf("------------------------------------------------\n");
+		printf("%s: core %u timer %lu\n", __func__,
+			rte_lcore_id(), tim - timer);
+	}
 	(void)reload_timer(tim);
 }
 
@@ -96,10 +93,10 @@ reload_timer(struct rte_timer *tim)
 
 	ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
 	if (ret != 0) {
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-		printf("- core %u failed to reset timer %lu (OK)\n",
-			rte_lcore_id(), tim - timer);
-#endif
+		if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+			printf("- core %u failed to reset timer %lu (OK)\n",
+				rte_lcore_id(), tim - timer);
+		}
 		RTE_PER_LCORE(n_reset_collisions) += 1;
 	}
 	return ret;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level
  2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
                   ` (2 preceding siblings ...)
  2018-11-29 20:31 ` [dpdk-dev] [PATCH 3/3] test/timer: " Dharmik Thakkar
@ 2019-01-11 16:30 ` Ferruh Yigit
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
  4 siblings, 0 replies; 23+ messages in thread
From: Ferruh Yigit @ 2019-01-11 16:30 UTC (permalink / raw)
  To: Dharmik Thakkar, byron.marohn, pablo.de.lara.guarch,
	bruce.richardson, rsanford
  Cc: dev

On 11/29/2018 8:31 PM, Dharmik Thakkar wrote:
> Currently, in test code, for printing extra information,
> compilation time options are used. This approach does not compile the
> code always. Macro needs to be set for the code to compile.
> 
> This patchset replaces compilation time option with log level based
> approach, thus enabling compilation of code always. Log levels can be
> set using eal parameters.
> 
> Dharmik Thakkar (3):
>   test/hash: replace macro with log-level approach
>   test/efd: enable unit test compilation always
>   test/timer: enable unit test compilation always

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2 0/3] Replace compilation time options with log level
  2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
                   ` (3 preceding siblings ...)
  2019-01-11 16:30 ` [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Ferruh Yigit
@ 2019-02-20 22:47 ` Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
                     ` (3 more replies)
  4 siblings, 4 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 22:47 UTC (permalink / raw)
  Cc: dev, Dharmik Thakkar

Currently, in test code, for printing extra information,
compilation time options are used. This approach does not compile the
code always. Macro needs to be set for the code to compile.

This patchset replaces compilation time option with log level based
approach, thus enabling compilation of code always. Log levels can be
set using eal parameters.

Dharmik Thakkar (3):
  test/hash: replace macro with log-level approach
  test/efd: enable unit test compilation always
  test/timer: enable unit test compilation always

 test/test/test_efd.c            | 24 ++++++++----------------
 test/test/test_hash.c           |  3 +--
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 3 files changed, 19 insertions(+), 31 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2 1/3] test/hash: replace macro with log-level approach
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
@ 2019-02-20 22:47   ` Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 22:47 UTC (permalink / raw)
  To: Bruce Richardson, Pablo de Lara; +Cc: dev, Dharmik Thakkar

Need to set hash log type to debug to print debug information, using
following eal parameter: --log-type=hash,8

Change-Id: I19c56d6e79c0b6d5c20284be3576a80e6bcca920
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/test/test_hash.c b/test/test/test_hash.c
index fe607fadf262..67b8e54bdf13 100644
--- a/test/test/test_hash.c
+++ b/test/test/test_hash.c
@@ -80,14 +80,13 @@ static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
 	return 3;
 }
 
-#define UNIT_TEST_HASH_VERBOSE	0
 /*
  * Print out result of unit test hash operation.
  */
 static void print_key_info(const char *msg, const struct flow_key *key,
 								int32_t pos)
 {
-	if (UNIT_TEST_HASH_VERBOSE) {
+	if (rte_log_get_level(RTE_LOGTYPE_HASH) == RTE_LOG_DEBUG) {
 		const uint8_t *p = (const uint8_t *)key;
 		unsigned int i;
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2 2/3] test/efd: enable unit test compilation always
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
@ 2019-02-20 22:47   ` Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 3/3] test/timer: " Dharmik Thakkar
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 22:47 UTC (permalink / raw)
  To: Byron Marohn, Pablo de Lara Guarch; +Cc: dev, Dharmik Thakkar

This patch enables compilation of print_key_info() always using
log-level based approach instead of a macro. Need to set efd log type
to debug to print debug information, using the following eal parameter:
--log-type=efd,8

Change-Id: I5ca3a943ac0d0de16ca4a9fe36f370b1dc5c6015
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_efd.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index ced091aab63d..3b6f9db13565 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -34,28 +34,20 @@ struct flow_key {
 /*
  * Print out result of unit test efd operation.
  */
-#if defined(UNIT_TEST_EFD_VERBOSE)
-
 static void print_key_info(const char *msg, const struct flow_key *key,
 		efd_value_t val)
 {
-	const uint8_t *p = (const uint8_t *) key;
-	unsigned int i;
+	if (rte_log_get_level(RTE_LOGTYPE_EFD) == RTE_LOG_DEBUG) {
+		const uint8_t *p = (const uint8_t *) key;
+		unsigned int i;
 
-	printf("%s key:0x", msg);
-	for (i = 0; i < sizeof(struct flow_key); i++)
-		printf("%02X", p[i]);
-
-	printf(" @ val %d\n", val);
-}
-#else
+		printf("%s key:0x", msg);
+		for (i = 0; i < sizeof(struct flow_key); i++)
+			printf("%02X", p[i]);
 
-static void print_key_info(__attribute__((unused)) const char *msg,
-		__attribute__((unused)) const struct flow_key *key,
-		__attribute__((unused)) efd_value_t val)
-{
+		printf(" @ val %d\n", val);
+	}
 }
-#endif
 
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = {
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2 3/3] test/timer: enable unit test compilation always
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
@ 2019-02-20 22:47   ` Dharmik Thakkar
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 22:47 UTC (permalink / raw)
  To: Robert Sanford; +Cc: dev, Dharmik Thakkar

This patch replaces macro with log-level based approach to print debug
information. Need to set timer log type to debug  using the following
eal parameter: --log-level=timer,8

Change-Id: I31e660e31b556ccade314a948226f0f076231a15
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
 * Add Reviewed-by tag 
---
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/test/test/test_timer_racecond.c b/test/test/test_timer_racecond.c
index d29048eaf1bf..5ac248b2d90b 100644
--- a/test/test/test_timer_racecond.c
+++ b/test/test/test_timer_racecond.c
@@ -44,8 +44,6 @@
 #include <rte_malloc.h>
 #include <rte_pause.h>
 
-#undef TEST_TIMER_RACECOND_VERBOSE
-
 #ifdef RTE_EXEC_ENV_LINUXAPP
 #define usec_delay(us) usleep(us)
 #else
@@ -70,13 +68,12 @@ timer_cb(struct rte_timer *tim, void *arg __rte_unused)
 {
 	/* Simulate slow callback function, 100 us. */
 	rte_delay_us(100);
-
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-	if (tim == &timer[0])
-		printf("------------------------------------------------\n");
-	printf("timer_cb: core %u timer %lu\n",
-		rte_lcore_id(), tim - timer);
-#endif
+	if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+		if (tim == &timer[0])
+			printf("------------------------------------------------\n");
+		printf("%s: core %u timer %lu\n", __func__,
+			rte_lcore_id(), tim - timer);
+	}
 	(void)reload_timer(tim);
 }
 
@@ -96,10 +93,10 @@ reload_timer(struct rte_timer *tim)
 
 	ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
 	if (ret != 0) {
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-		printf("- core %u failed to reset timer %lu (OK)\n",
-			rte_lcore_id(), tim - timer);
-#endif
+		if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+			printf("- core %u failed to reset timer %lu (OK)\n",
+				rte_lcore_id(), tim - timer);
+		}
 		RTE_PER_LCORE(n_reset_collisions) += 1;
 	}
 	return ret;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level
  2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
                     ` (2 preceding siblings ...)
  2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 3/3] test/timer: " Dharmik Thakkar
@ 2019-02-20 23:00   ` Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
                       ` (4 more replies)
  3 siblings, 5 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 23:00 UTC (permalink / raw)
  Cc: dev, Dharmik Thakkar

Currently, in test code, for printing extra information,
compilation time options are used. This approach does not compile the
code always. Macro needs to be set for the code to compile.

This patchset replaces compilation time option with log level based
approach, thus enabling compilation of code always. Log levels can be
set using eal parameters.

Dharmik Thakkar (3):
  test/hash: replace macro with log-level approach
  test/efd: enable unit test compilation always
  test/timer: enable unit test compilation always

 test/test/test_efd.c            | 24 ++++++++----------------
 test/test/test_hash.c           |  3 +--
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 3 files changed, 19 insertions(+), 31 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3 1/3] test/hash: replace macro with log-level approach
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
@ 2019-02-20 23:00     ` Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 23:00 UTC (permalink / raw)
  To: Bruce Richardson, Pablo de Lara; +Cc: dev, Dharmik Thakkar

Need to set hash log type to debug to print debug information, using
following eal parameter: --log-type=hash,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/test/test_hash.c b/test/test/test_hash.c
index fe607fadf262..67b8e54bdf13 100644
--- a/test/test/test_hash.c
+++ b/test/test/test_hash.c
@@ -80,14 +80,13 @@ static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
 	return 3;
 }
 
-#define UNIT_TEST_HASH_VERBOSE	0
 /*
  * Print out result of unit test hash operation.
  */
 static void print_key_info(const char *msg, const struct flow_key *key,
 								int32_t pos)
 {
-	if (UNIT_TEST_HASH_VERBOSE) {
+	if (rte_log_get_level(RTE_LOGTYPE_HASH) == RTE_LOG_DEBUG) {
 		const uint8_t *p = (const uint8_t *)key;
 		unsigned int i;
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3 2/3] test/efd: enable unit test compilation always
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
@ 2019-02-20 23:00     ` Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 3/3] test/timer: " Dharmik Thakkar
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 23:00 UTC (permalink / raw)
  To: Byron Marohn, Pablo de Lara Guarch; +Cc: dev, Dharmik Thakkar

This patch enables compilation of print_key_info() always using
log-level based approach instead of a macro. Need to set efd log type
to debug to print debug information, using the following eal parameter:
--log-type=efd,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_efd.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index ced091aab63d..3b6f9db13565 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -34,28 +34,20 @@ struct flow_key {
 /*
  * Print out result of unit test efd operation.
  */
-#if defined(UNIT_TEST_EFD_VERBOSE)
-
 static void print_key_info(const char *msg, const struct flow_key *key,
 		efd_value_t val)
 {
-	const uint8_t *p = (const uint8_t *) key;
-	unsigned int i;
+	if (rte_log_get_level(RTE_LOGTYPE_EFD) == RTE_LOG_DEBUG) {
+		const uint8_t *p = (const uint8_t *) key;
+		unsigned int i;
 
-	printf("%s key:0x", msg);
-	for (i = 0; i < sizeof(struct flow_key); i++)
-		printf("%02X", p[i]);
-
-	printf(" @ val %d\n", val);
-}
-#else
+		printf("%s key:0x", msg);
+		for (i = 0; i < sizeof(struct flow_key); i++)
+			printf("%02X", p[i]);
 
-static void print_key_info(__attribute__((unused)) const char *msg,
-		__attribute__((unused)) const struct flow_key *key,
-		__attribute__((unused)) efd_value_t val)
-{
+		printf(" @ val %d\n", val);
+	}
 }
-#endif
 
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = {
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3 3/3] test/timer: enable unit test compilation always
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
@ 2019-02-20 23:00     ` Dharmik Thakkar
  2019-02-20 23:08     ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Stephen Hemminger
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
  4 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-20 23:00 UTC (permalink / raw)
  To: Robert Sanford; +Cc: dev, Dharmik Thakkar

This patch replaces macro with log-level based approach to print debug
information. Need to set timer log type to debug  using the following
eal parameter: --log-level=timer,8

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag 
---
 test/test/test_timer_racecond.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/test/test/test_timer_racecond.c b/test/test/test_timer_racecond.c
index d29048eaf1bf..5ac248b2d90b 100644
--- a/test/test/test_timer_racecond.c
+++ b/test/test/test_timer_racecond.c
@@ -44,8 +44,6 @@
 #include <rte_malloc.h>
 #include <rte_pause.h>
 
-#undef TEST_TIMER_RACECOND_VERBOSE
-
 #ifdef RTE_EXEC_ENV_LINUXAPP
 #define usec_delay(us) usleep(us)
 #else
@@ -70,13 +68,12 @@ timer_cb(struct rte_timer *tim, void *arg __rte_unused)
 {
 	/* Simulate slow callback function, 100 us. */
 	rte_delay_us(100);
-
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-	if (tim == &timer[0])
-		printf("------------------------------------------------\n");
-	printf("timer_cb: core %u timer %lu\n",
-		rte_lcore_id(), tim - timer);
-#endif
+	if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+		if (tim == &timer[0])
+			printf("------------------------------------------------\n");
+		printf("%s: core %u timer %lu\n", __func__,
+			rte_lcore_id(), tim - timer);
+	}
 	(void)reload_timer(tim);
 }
 
@@ -96,10 +93,10 @@ reload_timer(struct rte_timer *tim)
 
 	ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
 	if (ret != 0) {
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-		printf("- core %u failed to reset timer %lu (OK)\n",
-			rte_lcore_id(), tim - timer);
-#endif
+		if (rte_log_get_level(RTE_LOGTYPE_TIMER) == RTE_LOG_DEBUG) {
+			printf("- core %u failed to reset timer %lu (OK)\n",
+				rte_lcore_id(), tim - timer);
+		}
 		RTE_PER_LCORE(n_reset_collisions) += 1;
 	}
 	return ret;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
                       ` (2 preceding siblings ...)
  2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 3/3] test/timer: " Dharmik Thakkar
@ 2019-02-20 23:08     ` Stephen Hemminger
  2019-02-26 23:05       ` Dharmik Thakkar
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
  4 siblings, 1 reply; 23+ messages in thread
From: Stephen Hemminger @ 2019-02-20 23:08 UTC (permalink / raw)
  To: Dharmik Thakkar; +Cc: dev

On Wed, 20 Feb 2019 17:00:20 -0600
Dharmik Thakkar <dharmik.thakkar@arm.com> wrote:

> Currently, in test code, for printing extra information,
> compilation time options are used. This approach does not compile the
> code always. Macro needs to be set for the code to compile.
> 
> This patchset replaces compilation time option with log level based
> approach, thus enabling compilation of code always. Log levels can be
> set using eal parameters.
> 
> Dharmik Thakkar (3):
>   test/hash: replace macro with log-level approach
>   test/efd: enable unit test compilation always
>   test/timer: enable unit test compilation always
> 
>  test/test/test_efd.c            | 24 ++++++++----------------
>  test/test/test_hash.c           |  3 +--
>  test/test/test_timer_racecond.c | 23 ++++++++++-------------
>  3 files changed, 19 insertions(+), 31 deletions(-)
> 

Maybe the tests should use their own dynamic logging (i.e. --log-level=test.hash:debug)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level
  2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
                       ` (3 preceding siblings ...)
  2019-02-20 23:08     ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Stephen Hemminger
@ 2019-02-26 23:02     ` Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
                         ` (3 more replies)
  4 siblings, 4 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-26 23:02 UTC (permalink / raw)
  Cc: dev, Dharmik Thakkar

Currently, in test code, for printing extra information,
compilation time options are used. This approach does not compile the
code always. Macro needs to be set for the code to compile.

This patchset replaces compilation time option with log level based
approach, thus enabling compilation of code always. Log levels can be
set using eal parameters.

Dharmik Thakkar (3):
  test/hash: replace macro with log-level approach
  test/efd: enable unit test compilation always
  test/timer: enable unit test compilation always

 test/test/test_efd.c            | 24 +++++++++++-------------
 test/test/test_hash.c           | 24 ++++++++++++++----------
 test/test/test_timer_racecond.c | 24 +++++++++++++-----------
 3 files changed, 38 insertions(+), 34 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v4 1/3] test/hash: replace macro with log-level approach
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
@ 2019-02-26 23:02       ` Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-26 23:02 UTC (permalink / raw)
  To: Bruce Richardson, Pablo de Lara; +Cc: dev, Dharmik Thakkar

Need to set hash log type to debug to print debug information, using
following eal parameter: --log-level=test.hash:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v4:
 * change to dynamic logging (Stephen Hemminger)
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_hash.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/test/test/test_hash.c b/test/test/test_hash.c
index fe607fadf262..390fbef87f42 100644
--- a/test/test/test_hash.c
+++ b/test/test/test_hash.c
@@ -69,6 +69,8 @@ struct flow_key {
 	uint8_t proto;
 } __attribute__((packed));
 
+int hash_logtype_test;
+
 /*
  * Hash function that always returns the same value, to easily test what
  * happens when a bucket is full.
@@ -80,22 +82,24 @@ static uint32_t pseudo_hash(__attribute__((unused)) const void *keys,
 	return 3;
 }
 
-#define UNIT_TEST_HASH_VERBOSE	0
+RTE_INIT(test_hash_init_log)
+{
+	hash_logtype_test = rte_log_register("test.hash");
+}
+
 /*
  * Print out result of unit test hash operation.
  */
 static void print_key_info(const char *msg, const struct flow_key *key,
 								int32_t pos)
 {
-	if (UNIT_TEST_HASH_VERBOSE) {
-		const uint8_t *p = (const uint8_t *)key;
-		unsigned int i;
-
-		printf("%s key:0x", msg);
-		for (i = 0; i < sizeof(struct flow_key); i++)
-			printf("%02X", p[i]);
-		printf(" @ pos %d\n", pos);
-	}
+	const uint8_t *p = (const uint8_t *)key;
+	unsigned int i;
+
+	rte_log(RTE_LOG_DEBUG, hash_logtype_test, "%s key:0x", msg);
+	for (i = 0; i < sizeof(struct flow_key); i++)
+		rte_log(RTE_LOG_DEBUG, hash_logtype_test, "%02X", p[i]);
+	rte_log(RTE_LOG_DEBUG, hash_logtype_test, " @ pos %d\n", pos);
 }
 
 /* Keys used by unit test functions */
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v4 2/3] test/efd: enable unit test compilation always
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
@ 2019-02-26 23:02       ` Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 3/3] test/timer: " Dharmik Thakkar
  2019-03-28 18:26       ` [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level Thomas Monjalon
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-26 23:02 UTC (permalink / raw)
  To: Byron Marohn, Pablo de Lara Guarch; +Cc: dev, Dharmik Thakkar

This patch enables compilation of print_key_info() always using
log-level based approach instead of a macro. Need to set efd log type
to debug to print debug information, using the following eal parameter:
--log-level=test.efd:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v4:
 * change to dynamic logging (Stephen Hemminger)
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_efd.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index ced091aab63d..93e8f1cbb8bd 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -31,31 +31,29 @@ struct flow_key {
 	uint16_t port_dst;
 	uint8_t proto;
 } __attribute__((packed));
+
+int efd_logtype_test;
+
+RTE_INIT(test_efd_init_log)
+{
+	efd_logtype_test = rte_log_register("test.efd");
+}
+
 /*
  * Print out result of unit test efd operation.
  */
-#if defined(UNIT_TEST_EFD_VERBOSE)
-
 static void print_key_info(const char *msg, const struct flow_key *key,
 		efd_value_t val)
 {
 	const uint8_t *p = (const uint8_t *) key;
 	unsigned int i;
 
-	printf("%s key:0x", msg);
+	rte_log(RTE_LOG_DEBUG, efd_logtype_test, "%s key:0x", msg);
 	for (i = 0; i < sizeof(struct flow_key); i++)
-		printf("%02X", p[i]);
+		rte_log(RTE_LOG_DEBUG, efd_logtype_test, "%02X", p[i]);
 
-	printf(" @ val %d\n", val);
+	rte_log(RTE_LOG_DEBUG, efd_logtype_test, " @ val %d\n", val);
 }
-#else
-
-static void print_key_info(__attribute__((unused)) const char *msg,
-		__attribute__((unused)) const struct flow_key *key,
-		__attribute__((unused)) efd_value_t val)
-{
-}
-#endif
 
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = {
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v4 3/3] test/timer: enable unit test compilation always
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
@ 2019-02-26 23:02       ` Dharmik Thakkar
  2019-03-28 18:26       ` [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level Thomas Monjalon
  3 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-26 23:02 UTC (permalink / raw)
  To: Robert Sanford; +Cc: dev, Dharmik Thakkar

This patch replaces macro with log-level based approach to print debug
information. Need to set timer log type to debug  using the following
eal parameter: --log-level=test.timer:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v4:
 * change to dynamic logging (Stephen Hemminger)
---
v3:
 * Resolve coding style issues
---
v2:
 * Add Reviewed-by tag
---
 test/test/test_timer_racecond.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/test/test/test_timer_racecond.c b/test/test/test_timer_racecond.c
index d29048eaf1bf..62b73f886a1f 100644
--- a/test/test/test_timer_racecond.c
+++ b/test/test/test_timer_racecond.c
@@ -44,8 +44,6 @@
 #include <rte_malloc.h>
 #include <rte_pause.h>
 
-#undef TEST_TIMER_RACECOND_VERBOSE
-
 #ifdef RTE_EXEC_ENV_LINUXAPP
 #define usec_delay(us) usleep(us)
 #else
@@ -65,18 +63,23 @@ static volatile unsigned stop_slaves;
 
 static int reload_timer(struct rte_timer *tim);
 
+int timer_logtype_test;
+
+RTE_INIT(test_timer_init_log)
+{
+	timer_logtype_test = rte_log_register("test.timer");
+}
+
 static void
 timer_cb(struct rte_timer *tim, void *arg __rte_unused)
 {
 	/* Simulate slow callback function, 100 us. */
 	rte_delay_us(100);
-
-#ifdef TEST_TIMER_RACECOND_VERBOSE
 	if (tim == &timer[0])
-		printf("------------------------------------------------\n");
-	printf("timer_cb: core %u timer %lu\n",
-		rte_lcore_id(), tim - timer);
-#endif
+		rte_log(RTE_LOG_DEBUG, timer_logtype_test,
+			"------------------------------------------------\n");
+	rte_log(RTE_LOG_DEBUG, timer_logtype_test, "%s: core %u timer %lu\n",
+		__func__, rte_lcore_id(), tim - timer);
 	(void)reload_timer(tim);
 }
 
@@ -96,10 +99,9 @@ reload_timer(struct rte_timer *tim)
 
 	ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
 	if (ret != 0) {
-#ifdef TEST_TIMER_RACECOND_VERBOSE
-		printf("- core %u failed to reset timer %lu (OK)\n",
+		rte_log(RTE_LOG_DEBUG, timer_logtype_test,
+			"- core %u failed to reset timer %lu (OK)\n",
 			rte_lcore_id(), tim - timer);
-#endif
 		RTE_PER_LCORE(n_reset_collisions) += 1;
 	}
 	return ret;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level
  2019-02-20 23:08     ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Stephen Hemminger
@ 2019-02-26 23:05       ` Dharmik Thakkar
  0 siblings, 0 replies; 23+ messages in thread
From: Dharmik Thakkar @ 2019-02-26 23:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, nd



> On Feb 20, 2019, at 5:08 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Wed, 20 Feb 2019 17:00:20 -0600
> Dharmik Thakkar <dharmik.thakkar@arm.com> wrote:
> 
>> Currently, in test code, for printing extra information,
>> compilation time options are used. This approach does not compile the
>> code always. Macro needs to be set for the code to compile.
>> 
>> This patchset replaces compilation time option with log level based
>> approach, thus enabling compilation of code always. Log levels can be
>> set using eal parameters.
>> 
>> Dharmik Thakkar (3):
>>  test/hash: replace macro with log-level approach
>>  test/efd: enable unit test compilation always
>>  test/timer: enable unit test compilation always
>> 
>> test/test/test_efd.c            | 24 ++++++++----------------
>> test/test/test_hash.c           |  3 +--
>> test/test/test_timer_racecond.c | 23 ++++++++++-------------
>> 3 files changed, 19 insertions(+), 31 deletions(-)
>> 
> 
> Maybe the tests should use their own dynamic logging (i.e. --log-level=test.hash:debug)
Updated. Thank you!

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level
  2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
                         ` (2 preceding siblings ...)
  2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 3/3] test/timer: " Dharmik Thakkar
@ 2019-03-28 18:26       ` Thomas Monjalon
  2019-03-28 18:26         ` Thomas Monjalon
  2019-03-28 18:35         ` Thomas Monjalon
  3 siblings, 2 replies; 23+ messages in thread
From: Thomas Monjalon @ 2019-03-28 18:26 UTC (permalink / raw)
  To: Dharmik Thakkar; +Cc: dev

> Dharmik Thakkar (3):
>   test/hash: replace macro with log-level approach
>   test/efd: enable unit test compilation always
>   test/timer: enable unit test compilation always

Applied, thanks

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level
  2019-03-28 18:26       ` [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level Thomas Monjalon
@ 2019-03-28 18:26         ` Thomas Monjalon
  2019-03-28 18:35         ` Thomas Monjalon
  1 sibling, 0 replies; 23+ messages in thread
From: Thomas Monjalon @ 2019-03-28 18:26 UTC (permalink / raw)
  To: Dharmik Thakkar; +Cc: dev

> Dharmik Thakkar (3):
>   test/hash: replace macro with log-level approach
>   test/efd: enable unit test compilation always
>   test/timer: enable unit test compilation always

Applied, thanks




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level
  2019-03-28 18:26       ` [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level Thomas Monjalon
  2019-03-28 18:26         ` Thomas Monjalon
@ 2019-03-28 18:35         ` Thomas Monjalon
  2019-03-28 18:35           ` Thomas Monjalon
  1 sibling, 1 reply; 23+ messages in thread
From: Thomas Monjalon @ 2019-03-28 18:35 UTC (permalink / raw)
  To: Dharmik Thakkar; +Cc: dev

28/03/2019 19:26, Thomas Monjalon:
> > Dharmik Thakkar (3):
> >   test/hash: replace macro with log-level approach
> >   test/efd: enable unit test compilation always
> >   test/timer: enable unit test compilation always
> 
> Applied, thanks

PS: for 32-bit build, I had to replace "%lu" by "%"PRIuPTR.
in third patch (app/test/test_timer_racecond.c).

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level
  2019-03-28 18:35         ` Thomas Monjalon
@ 2019-03-28 18:35           ` Thomas Monjalon
  0 siblings, 0 replies; 23+ messages in thread
From: Thomas Monjalon @ 2019-03-28 18:35 UTC (permalink / raw)
  To: Dharmik Thakkar; +Cc: dev

28/03/2019 19:26, Thomas Monjalon:
> > Dharmik Thakkar (3):
> >   test/hash: replace macro with log-level approach
> >   test/efd: enable unit test compilation always
> >   test/timer: enable unit test compilation always
> 
> Applied, thanks

PS: for 32-bit build, I had to replace "%lu" by "%"PRIuPTR.
in third patch (app/test/test_timer_racecond.c).




^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-03-28 18:35 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 20:31 [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Dharmik Thakkar
2018-11-29 20:31 ` [dpdk-dev] [PATCH 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
2018-11-29 20:31 ` [dpdk-dev] [PATCH 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
2018-11-29 20:31 ` [dpdk-dev] [PATCH 3/3] test/timer: " Dharmik Thakkar
2019-01-11 16:30 ` [dpdk-dev] [PATCH 0/3] Replace compilation time options with log level Ferruh Yigit
2019-02-20 22:47 ` [dpdk-dev] [PATCH v2 " Dharmik Thakkar
2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
2019-02-20 22:47   ` [dpdk-dev] [PATCH v2 3/3] test/timer: " Dharmik Thakkar
2019-02-20 23:00   ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Dharmik Thakkar
2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
2019-02-20 23:00     ` [dpdk-dev] [PATCH v3 3/3] test/timer: " Dharmik Thakkar
2019-02-20 23:08     ` [dpdk-dev] [PATCH v3 0/3] Replace compilation time options with log level Stephen Hemminger
2019-02-26 23:05       ` Dharmik Thakkar
2019-02-26 23:02     ` [dpdk-dev] [PATCH v4 " Dharmik Thakkar
2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 1/3] test/hash: replace macro with log-level approach Dharmik Thakkar
2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 2/3] test/efd: enable unit test compilation always Dharmik Thakkar
2019-02-26 23:02       ` [dpdk-dev] [PATCH v4 3/3] test/timer: " Dharmik Thakkar
2019-03-28 18:26       ` [dpdk-dev] [PATCH v4 0/3] Replace compilation time options with log level Thomas Monjalon
2019-03-28 18:26         ` Thomas Monjalon
2019-03-28 18:35         ` Thomas Monjalon
2019-03-28 18:35           ` Thomas Monjalon

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).