[v3,13/13] app/test: use log register macro
Checks
Commit Message
From: Jerin Jacob <jerinj@marvell.com>
Use log register macro to avoid the code duplication
in the log registration process.
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
app/test/test_efd.c | 6 +-----
app/test/test_hash.c | 7 +------
app/test/test_timer_racecond.c | 7 +------
3 files changed, 3 insertions(+), 17 deletions(-)
@@ -32,12 +32,8 @@ struct flow_key {
uint8_t proto;
} __rte_packed;
-int efd_logtype_test;
-RTE_INIT(test_efd_init_log)
-{
- efd_logtype_test = rte_log_register("test.efd");
-}
+RTE_LOG_REGISTER(efd_logtype_test, test.efd, INFO);
/*
* Print out result of unit test efd operation.
@@ -69,8 +69,6 @@ struct flow_key {
uint8_t proto;
} __rte_packed;
-int hash_logtype_test;
-
/*
* Hash function that always returns the same value, to easily test what
* happens when a bucket is full.
@@ -82,10 +80,7 @@ static uint32_t pseudo_hash(__rte_unused const void *keys,
return 3;
}
-RTE_INIT(test_hash_init_log)
-{
- hash_logtype_test = rte_log_register("test.hash");
-}
+RTE_LOG_REGISTER(hash_logtype_test, test.hash, INFO);
/*
* Print out result of unit test hash operation.
@@ -61,12 +61,7 @@ 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");
-}
+RTE_LOG_REGISTER(timer_logtype_test, test.timer, INFO);
static void
timer_cb(struct rte_timer *tim, void *arg __rte_unused)