log: use simple macro
authorThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 30 Jul 2015 18:03:19 +0000 (20:03 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 30 Jul 2015 18:16:04 +0000 (20:16 +0200)
For consistency, RTE_LOG macro should be used instead of rte_log function.
The macro can be pruned at build time, though these logs have a high level
and should not pruned.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
examples/l3fwd-power/main.c
lib/librte_eal/common/eal_common_tailqs.c

index 912012b..2f205ea 100644 (file)
@@ -1710,9 +1710,8 @@ main(int argc, char **argv)
                /* init power management library */
                ret = rte_power_init(lcore_id);
                if (ret)
-                       rte_log(RTE_LOG_ERR, RTE_LOGTYPE_POWER,
-                               "Power management library initialization "
-                               "failed on core%u", lcore_id);
+                       RTE_LOG(ERR, POWER,
+                               "Library initialization failed on core %u\n", lcore_id);
 
                /* init timer structures for each enabled lcore */
                rte_timer_init(&power_timers[lcore_id]);
index d9551cd..bb08ec8 100644 (file)
@@ -150,7 +150,7 @@ int
 rte_eal_tailq_register(struct rte_tailq_elem *t)
 {
        if (rte_eal_tailq_local_register(t) < 0) {
-               rte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,
+               RTE_LOG(ERR, EAL,
                        "%s tailq is already registered\n", t->name);
                goto error;
        }
@@ -160,7 +160,7 @@ rte_eal_tailq_register(struct rte_tailq_elem *t)
        if (rte_tailqs_count >= 0) {
                rte_eal_tailq_update(t);
                if (t->head == NULL) {
-                       rte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,
+                       RTE_LOG(ERR, EAL,
                                "Cannot initialize tailq: %s\n", t->name);
                        TAILQ_REMOVE(&rte_tailq_elem_head, t, next);
                        goto error;
@@ -186,7 +186,7 @@ rte_eal_tailqs_init(void)
                 * rte_eal_tailq_register and EAL_REGISTER_TAILQ */
                rte_eal_tailq_update(t);
                if (t->head == NULL) {
-                       rte_log(RTE_LOG_ERR, RTE_LOGTYPE_EAL,
+                       RTE_LOG(ERR, EAL,
                                "Cannot initialize tailq: %s\n", t->name);
                        /* no need to TAILQ_REMOVE, we are going to panic in
                         * rte_eal_init() */