[v3,1/3] test/hash: replace macro with log-level approach

Message ID 20190220230023.17029-2-dharmik.thakkar@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Replace compilation time options with log level |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Dharmik Thakkar Feb. 20, 2019, 11 p.m. UTC
  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(-)
  

Patch

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;