diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-12-16 15:26:49 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-12-17 17:53:07 +0000 |
commit | 7176b800fa5570a14d9d403183131f5115158baf (patch) | |
tree | 89cd45e23a73165a95690f9ab241d27f85b7d0df /src/plugins/perfmon/perfmon.c | |
parent | e11dce20c99775884877ad6dcf879e8995c78ebf (diff) |
perfmon: fix per-worker data initialization
When perfmon_init is called at initialization time worker threads are
not created yet and vec_len(vlib_mains) returns 1.
Initialize per-worker data when the number of workers is known, when
enabling data collection instead.
Type: fix
Change-Id: I36887cc7b2a3e88d9728d3cd7262d9b1c968dd3c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/perfmon/perfmon.c')
-rw-r--r-- | src/plugins/perfmon/perfmon.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c index 552c88757f7..7e276c30810 100644 --- a/src/plugins/perfmon/perfmon.c +++ b/src/plugins/perfmon/perfmon.c @@ -110,14 +110,8 @@ perfmon_init (vlib_main_t * vm) /* Default data collection interval */ pm->timeout_interval = 2.0; /* seconds */ vec_validate (pm->pm_fds, 1); - vec_validate (pm->pm_fds[0], vec_len (vlib_mains) - 1); - vec_validate (pm->pm_fds[1], vec_len (vlib_mains) - 1); vec_validate (pm->perf_event_pages, 1); - vec_validate (pm->perf_event_pages[0], vec_len (vlib_mains) - 1); - vec_validate (pm->perf_event_pages[1], vec_len (vlib_mains) - 1); vec_validate (pm->rdpmc_indices, 1); - vec_validate (pm->rdpmc_indices[0], vec_len (vlib_mains) - 1); - vec_validate (pm->rdpmc_indices[1], vec_len (vlib_mains) - 1); pm->page_size = getpagesize (); pm->perfmon_table = 0; |