diff options
author | mdr78 <mdr@ashroe.eu> | 2021-03-19 19:03:54 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-04-27 09:22:35 +0000 |
commit | 8e1384f7bf2e806e0d65d07af38da269ef1b8338 (patch) | |
tree | 4fd4720a58cfeec80550388d37c208b8befc02ac /src/plugins/perfmon/perfmon.c | |
parent | 3f923d2d465aadec8d70fa19e0559030751c2c6c (diff) |
perfmon: top down level 1 support
Adding perfmon node TMAM support on ICX.
Type: improvement
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I48a9a9ff6a72efc28eaf0cb11ef39fb62cebb126
Diffstat (limited to 'src/plugins/perfmon/perfmon.c')
-rw-r--r-- | src/plugins/perfmon/perfmon.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c index f9402f8f8e9..46c8cf9ca04 100644 --- a/src/plugins/perfmon/perfmon.c +++ b/src/plugins/perfmon/perfmon.c @@ -193,6 +193,7 @@ perfmon_set (vlib_main_t *vm, perfmon_bundle_t *b) { perfmon_thread_runtime_t *rt; rt = vec_elt_at_index (pm->thread_runtimes, i); + rt->bundle = b; rt->n_events = b->n_events; rt->n_nodes = n_nodes; vec_validate_aligned (rt->node_stats, n_nodes - 1, @@ -235,11 +236,20 @@ perfmon_start (vlib_main_t *vm, perfmon_bundle_t *b) return clib_error_return_unix (0, "ioctl(PERF_EVENT_IOC_ENABLE)"); } } - if (pm->active_bundle->type == PERFMON_BUNDLE_TYPE_NODE) + if (b->type == PERFMON_BUNDLE_TYPE_NODE) { + + vlib_node_function_t *funcs[PERFMON_OFFSET_TYPE_MAX]; +#define _(type, pfunc) funcs[type] = pfunc; + + foreach_permon_offset_type +#undef _ + + ASSERT (funcs[b->offset_type]); + for (int i = 0; i < vlib_get_n_threads (); i++) vlib_node_set_dispatch_wrapper (vlib_get_main_by_index (i), - perfmon_dispatch_wrapper); + funcs[b->offset_type]); } pm->sample_time = vlib_time_now (vm); |