diff options
author | Dave Barach <dave@barachs.net> | 2019-05-01 11:30:13 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-05-01 18:55:42 +0000 |
commit | 17e5d8031f385c8ede56c59bd50957f0ea6cd2ce (patch) | |
tree | 68d71437cc817873214ef0fbab9a18d1536ef113 /src/vlib | |
parent | 154a903a958ee6459ae1019883e6c4796b4cafc7 (diff) |
Add node, frame to vlib main loop perf analysis callback arguments
Change-Id: Iaa5cd89791b0dfdb56a75009c564581d10696d83
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/main.c | 15 | ||||
-rw-r--r-- | src/vlib/main.h | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c index ecadc19b1d5..759c1d0ec0d 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -680,13 +680,16 @@ vlib_node_runtime_update_stats (vlib_main_t * vm, return r; } -static inline void -vlib_node_runtime_perf_counter (vlib_main_t * vm, u64 * pmc0, u64 * pmc1) +always_inline void +vlib_node_runtime_perf_counter (vlib_main_t * vm, u64 * pmc0, u64 * pmc1, + vlib_node_runtime_t * node, + vlib_frame_t * frame, int before_or_after) { *pmc0 = 0; *pmc1 = 0; if (PREDICT_FALSE (vm->vlib_node_runtime_perf_counter_cb != 0)) - (*vm->vlib_node_runtime_perf_counter_cb) (vm, pmc0, pmc1); + (*vm->vlib_node_runtime_perf_counter_cb) (vm, pmc0, pmc1, node, + frame, before_or_after); } always_inline void @@ -1181,7 +1184,8 @@ dispatch_node (vlib_main_t * vm, last_time_stamp, frame ? frame->n_vectors : 0, /* is_after */ 0); - vlib_node_runtime_perf_counter (vm, &pmc_before[0], &pmc_before[1]); + vlib_node_runtime_perf_counter (vm, &pmc_before[0], &pmc_before[1], + node, frame, 0 /* before */ ); /* * Turn this on if you run into @@ -1215,7 +1219,8 @@ dispatch_node (vlib_main_t * vm, * To validate accounting: pmc_delta = t - pmc_before; * perf ticks should equal clocks/pkt... */ - vlib_node_runtime_perf_counter (vm, &pmc_after[0], &pmc_after[1]); + vlib_node_runtime_perf_counter (vm, &pmc_after[0], &pmc_after[1], node, + frame, 1 /* after */ ); pmc_delta[0] = pmc_after[0] - pmc_before[0]; pmc_delta[1] = pmc_after[1] - pmc_before[1]; diff --git a/src/vlib/main.h b/src/vlib/main.h index d2c42135d88..42f0c5196da 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -95,7 +95,9 @@ typedef struct vlib_main_t /* Main loop hw / sw performance counters */ void (*vlib_node_runtime_perf_counter_cb) (struct vlib_main_t *, - u64 *, u64 *); + u64 *, u64 *, + vlib_node_runtime_t *, + vlib_frame_t *, int); /* Every so often we switch to the next counter. */ #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7 |