ethdev: fix build when vtune profiling is on
[dpdk.git] / lib / librte_power / rte_power_empty_poll.c
index c1e10e0..70c07b1 100644 (file)
@@ -8,6 +8,7 @@
 #include <rte_cycles.h>
 #include <rte_atomic.h>
 #include <rte_malloc.h>
+#include <inttypes.h>
 
 #include "rte_power.h"
 #include "rte_power_empty_poll.h"
@@ -51,13 +52,13 @@ set_power_freq(int lcore_id, enum freq_val freq, bool specific_freq)
 }
 
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 exit_training_state(struct priority_worker *poll_stats)
 {
        RTE_SET_USED(poll_stats);
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_training_state(struct priority_worker *poll_stats)
 {
        poll_stats->iter_counter = 0;
@@ -65,7 +66,7 @@ enter_training_state(struct priority_worker *poll_stats)
        poll_stats->queue_state = TRAINING;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_normal_state(struct priority_worker *poll_stats)
 {
        /* Clear the averages arrays and strs */
@@ -85,7 +86,7 @@ enter_normal_state(struct priority_worker *poll_stats)
        poll_stats->thresh[HGH].threshold_percent = high_to_med_threshold;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_busy_state(struct priority_worker *poll_stats)
 {
        memset(poll_stats->edpi_av, 0, sizeof(poll_stats->edpi_av));
@@ -100,14 +101,14 @@ enter_busy_state(struct priority_worker *poll_stats)
        set_power_freq(poll_stats->lcore_id, HGH, false);
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 enter_purge_state(struct priority_worker *poll_stats)
 {
        poll_stats->iter_counter = 0;
        poll_stats->queue_state = LOW_PURGE;
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 set_state(struct priority_worker *poll_stats,
                enum queue_state new_state)
 {
@@ -130,7 +131,7 @@ set_state(struct priority_worker *poll_stats,
        }
 }
 
-static inline void __attribute__((always_inline))
+static __rte_always_inline void
 set_policy(struct priority_worker *poll_stats,
                struct ep_policy *policy)
 {
@@ -155,11 +156,8 @@ update_training_stats(struct priority_worker *poll_stats,
 {
        RTE_SET_USED(specific_freq);
 
-       char pfi_str[32];
        uint64_t p0_empty_deq;
 
-       sprintf(pfi_str, "%02d", freq);
-
        if (poll_stats->cur_freq == freq &&
                        poll_stats->thresh[freq].trained == false) {
                if (poll_stats->thresh[freq].cur_train_iter == 0) {
@@ -206,7 +204,7 @@ update_training_stats(struct priority_worker *poll_stats,
        }
 }
 
-static inline uint32_t __attribute__((always_inline))
+static __rte_always_inline uint32_t
 update_stats(struct priority_worker *poll_stats)
 {
        uint64_t tot_edpi = 0, tot_ppi = 0;
@@ -226,8 +224,8 @@ update_stats(struct priority_worker *poll_stats)
 
                /* edpi mean empty poll counter difference per interval */
                RTE_LOG(DEBUG, POWER, "cur_edpi is too large "
-                               "cur edpi %ld "
-                               "base edpi %ld\n",
+                               "cur edpi %"PRId64" "
+                               "base edpi %"PRId64"\n",
                                cur_edpi,
                                s->thresh[s->cur_freq].base_edpi);
                /* Value to make us fail need debug log*/
@@ -251,7 +249,7 @@ update_stats(struct priority_worker *poll_stats)
 }
 
 
-static inline void  __attribute__((always_inline))
+static __rte_always_inline void
 update_stats_normal(struct priority_worker *poll_stats)
 {
        uint32_t percent;
@@ -261,7 +259,7 @@ update_stats_normal(struct priority_worker *poll_stats)
                enum freq_val cur_freq = poll_stats->cur_freq;
 
                /* edpi mean empty poll counter difference per interval */
-               RTE_LOG(DEBUG, POWER, "cure freq is %d, edpi is %lu\n",
+               RTE_LOG(DEBUG, POWER, "cure freq is %d, edpi is %"PRIu64"\n",
                                cur_freq,
                                poll_stats->thresh[cur_freq].base_edpi);
                return;
@@ -346,14 +344,14 @@ empty_poll_training(struct priority_worker *poll_stats,
 
                set_state(poll_stats, MED_NORMAL);
 
-               RTE_LOG(INFO, POWER, "LOW threshold is %lu\n",
+               RTE_LOG(INFO, POWER, "LOW threshold is %"PRIu64"\n",
                                poll_stats->thresh[LOW].base_edpi);
 
-               RTE_LOG(INFO, POWER, "MED threshold is %lu\n",
+               RTE_LOG(INFO, POWER, "MED threshold is %"PRIu64"\n",
                                poll_stats->thresh[MED].base_edpi);
 
 
-               RTE_LOG(INFO, POWER, "HIGH threshold is %lu\n",
+               RTE_LOG(INFO, POWER, "HIGH threshold is %"PRIu64"\n",
                                poll_stats->thresh[HGH].base_edpi);
 
                RTE_LOG(INFO, POWER, "Training is Complete for %d\n",
@@ -363,7 +361,7 @@ empty_poll_training(struct priority_worker *poll_stats,
        return 0;
 }
 
-void __rte_experimental
+void
 rte_empty_poll_detection(struct rte_timer *tim, void *arg)
 {
 
@@ -404,7 +402,7 @@ rte_empty_poll_detection(struct rte_timer *tim, void *arg)
 
 }
 
-int __rte_experimental
+int
 rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
                struct ep_policy *policy)
 {
@@ -463,7 +461,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
        return 0;
 }
 
-void __rte_experimental
+void
 rte_power_empty_poll_stat_free(void)
 {
 
@@ -473,7 +471,7 @@ rte_power_empty_poll_stat_free(void)
                rte_free(ep_params);
 }
 
-int __rte_experimental
+int
 rte_power_empty_poll_stat_update(unsigned int lcore_id)
 {
        struct priority_worker *poll_stats;
@@ -491,7 +489,7 @@ rte_power_empty_poll_stat_update(unsigned int lcore_id)
        return 0;
 }
 
-int __rte_experimental
+int
 rte_power_poll_stat_update(unsigned int lcore_id, uint8_t nb_pkt)
 {
 
@@ -511,7 +509,7 @@ rte_power_poll_stat_update(unsigned int lcore_id, uint8_t nb_pkt)
 }
 
 
-uint64_t __rte_experimental
+uint64_t
 rte_power_empty_poll_stat_fetch(unsigned int lcore_id)
 {
        struct priority_worker *poll_stats;
@@ -527,7 +525,7 @@ rte_power_empty_poll_stat_fetch(unsigned int lcore_id)
        return poll_stats->empty_dequeues;
 }
 
-uint64_t __rte_experimental
+uint64_t
 rte_power_poll_stat_fetch(unsigned int lcore_id)
 {
        struct priority_worker *poll_stats;