17 #include <perfmon/perfmon.h> 19 #include <linux/perf_event.h> 22 #define _(event, umask, edge, any, inv, cmask, n, suffix, desc) \ 23 [INTEL_CORE_E_##n##_##suffix] = { .type = PERF_TYPE_RAW, \ 24 .config = PERF_INTEL_CODE ( \ 25 event, umask, edge, any, inv, cmask), \ 26 .name = #n "." #suffix, \ 27 .description = desc, \ 28 .exclude_kernel = 1 }, 37 u64 config = va_arg (*args,
u64);
40 s =
format (s,
"event=0x%02x, umask=0x%02x", config & 0xff,
41 (config >> 8) & 0xff);
43 if ((v = (config >> 18) & 1))
44 s =
format (s,
", edge=%u", v);
46 if ((v = (config >> 19) & 1))
47 s =
format (s,
", pc=%u", v);
49 if ((v = (config >> 21) & 1))
50 s =
format (s,
", any=%u", v);
52 if ((v = (config >> 23) & 1))
53 s =
format (s,
", inv=%u", v);
55 if ((v = (config >> 24) & 0xff))
56 s =
format (s,
", cmask=0x%02x", v);
64 u32 eax, ebx, ecx, edx;
65 if (__get_cpuid (0, &eax, &ebx, &ecx, &edx) == 0)
69 if (ebx != 0x756e6547 || ecx != 0x6c65746e || edx != 0x49656e69)
76 .description =
"intel arch core events",
description fragment has unexpected format
#define clib_error_return(e, args...)
static perfmon_event_t events[]
#define foreach_perf_intel_core_event
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * intel_core_init(vlib_main_t *vm, perfmon_source_t *src)
u8 * format_intel_core_config(u8 *s, va_list *args)
PERFMON_REGISTER_SOURCE(intel_core)