diff options
author | Tom Seidenberg <tseidenb@cisco.com> | 2020-07-10 15:49:03 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-07-16 21:44:42 +0000 |
commit | 6c81f5a2493ff65b4dacfef45db8a1ee459a738f (patch) | |
tree | 24343a92e18599be4e4b4aa360ab7b2c13cdb878 /src/plugins/perfmon/perfmon.h | |
parent | bab02f0b184b63c4159ded030cf34044be10da40 (diff) |
misc: add callback hooks and refactor pmc
Callbacks for monitoring and performance measurement:
- Add new callback list type, with context
- Add callbacks for API, CLI, and barrier sync
- Modify node dispatch callback to pass plugin-specific context
- Modify perfmon plugin to keep PMC samples local to the plugin
- Include process nodes in dispatch callback
- Pass dispatch function return value to callback
Type: refactor
Signed-off-by: Tom Seidenberg <tseidenb@cisco.com>
Change-Id: I28b06c58490611e08d76ff5b01b2347ba2109b22
Diffstat (limited to 'src/plugins/perfmon/perfmon.h')
-rw-r--r-- | src/plugins/perfmon/perfmon.h | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/plugins/perfmon/perfmon.h b/src/plugins/perfmon/perfmon.h index 000e3c2849c..c8782023597 100644 --- a/src/plugins/perfmon/perfmon.h +++ b/src/plugins/perfmon/perfmon.h @@ -78,6 +78,32 @@ typedef struct typedef struct { + u64 ticks[2]; + u64 vectors; +} perfmon_counters_t; + +typedef struct +{ + CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); + + /* Current counters */ + u64 c[2]; + + /* Current perf_event file descriptors, per thread */ + int pm_fds[2]; + + /* mmap base of mapped struct perf_event_mmap_page */ + u8 *perf_event_pages[2]; + + u32 rdpmc_indices[2]; + + /* vector of counters by node index */ + perfmon_counters_t *counters; + +} perfmon_thread_t; + +typedef struct +{ /* API message ID base */ u16 msg_id_base; @@ -112,17 +138,15 @@ typedef struct /* Current event (index) being collected */ u32 current_event; int n_active; - u32 **rdpmc_indices; - /* mmap base / size of (mapped) struct perf_event_mmap_page */ - u8 ***perf_event_pages; + /* mmap size of (mapped) struct perf_event_mmap_page */ u32 page_size; - /* Current perf_event file descriptors, per thread */ - int **pm_fds; - /* thread bitmap */ uword *thread_bitmap; + /* per-thread data */ + perfmon_thread_t **threads; + /* Logging */ vlib_log_class_t log_class; @@ -137,6 +161,8 @@ extern perfmon_main_t perfmon_main; extern vlib_node_registration_t perfmon_periodic_node; uword *perfmon_parse_table (perfmon_main_t * pm, char *path, char *filename); +uword unformat_processor_event (unformat_input_t * input, va_list * args); + /* Periodic function events */ #define PERFMON_START 1 |