MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_current_stat_values

Function get_current_stat_values

dpdk/examples/l3fwd-power/main.c:2305–2332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2303}
2304
2305static void
2306get_current_stat_values(uint64_t *values)
2307{
2308 unsigned int lcore_id = rte_lcore_id();
2309 struct lcore_conf *qconf;
2310 uint64_t app_eps = 0, app_fps = 0, app_br = 0;
2311 uint64_t count = 0;
2312
2313 RTE_LCORE_FOREACH_WORKER(lcore_id) {
2314 qconf = &lcore_conf[lcore_id];
2315 if (qconf->n_rx_queue == 0)
2316 continue;
2317 count++;
2318 rte_spinlock_lock(&stats[lcore_id].telemetry_lock);
2319 app_eps += stats[lcore_id].ep_nep[1];
2320 app_fps += stats[lcore_id].fp_nfp[1];
2321 app_br += stats[lcore_id].br;
2322 rte_spinlock_unlock(&stats[lcore_id].telemetry_lock);
2323 }
2324
2325 if (count > 0) {
2326 values[0] = app_eps/count;
2327 values[1] = app_fps/count;
2328 values[2] = app_br/count;
2329 } else
2330 memset(values, 0, sizeof(uint64_t) * NUM_TELSTATS);
2331
2332}
2333
2334static void
2335update_telemetry(__rte_unused struct rte_timer *tim,

Callers 2

update_telemetryFunction · 0.85
handle_app_statsFunction · 0.85

Calls 4

rte_lcore_idFunction · 0.85
memsetFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected