20 #include <vpp/app/version.h> 21 #include <linux/limits.h> 22 #include <sys/ioctl.h> 24 #include <perfmon/perfmon.h> 26 #include <linux/perf_event.h> 28 #define foreach_perf_sw_counter \ 29 _ (CONTEXT_SWITCHES, "context-switches") \ 30 _ (PAGE_FAULTS_MIN, "page-faults-minor") \ 31 _ (PAGE_FAULTS_MAJ, "page-faults-major") 42 [n] = { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##n, .name = s }, 49 .description =
"Linux kernel performance counters",
58 int row = va_arg (*args,
int);
64 s =
format (s,
"%9.2f", t);
75 .name =
"context-switches",
76 .description =
"per-thread context switches",
79 .events[0] = CONTEXT_SWITCHES,
89 int row = va_arg (*args,
int);
95 s =
format (s,
"%9.2f", t);
110 .name =
"page-faults",
111 .description =
"per-thread page faults",
114 .events[0] = PAGE_FAULTS_MIN,
115 .events[1] = PAGE_FAULTS_MAJ,
119 "MajorPageFaults/Sec"),
static perfmon_event_t events[]
vnet_hw_if_output_node_runtime_t * r
description fragment has unexpected format
#define foreach_perf_sw_counter
#define PERFMON_STRINGS(...)
u64 value[PERF_MAX_EVENTS]
static u8 * format_page_faults(u8 *s, va_list *args)
static u8 * format_context_switches(u8 *s, va_list *args)
PERFMON_REGISTER_SOURCE(linux)
PERFMON_REGISTER_BUNDLE(context_switches)