8 #include "arch-tests.h" 44 struct perf_event_attr pe;
45 int i, fd[2],
flag, ret;
55 pr_debug(
"perf_evlist__new failed\n");
59 ret =
parse_events(evlist,
"intel_cqm/llc_occupancy/", NULL);
61 pr_debug(
"parse_events failed, is \"intel_cqm/llc_occupancy/\" available?\n");
68 pr_debug(
"perf_evlist__first failed\n");
72 memset(&pe, 0,
sizeof(pe));
75 pe.type = PERF_TYPE_HARDWARE;
76 pe.config = PERF_COUNT_HW_CPU_CYCLES;
77 pe.read_format = PERF_FORMAT_GROUP;
79 pe.sample_period = 128;
80 pe.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_READ;
90 memset(&pe, 0,
sizeof(pe));
93 pe.type = evsel->
attr.type;
94 pe.config = evsel->
attr.config;
108 event = mmap(NULL, mmap_len, PROT_READ, MAP_SHARED, fd[0], 0);
109 if (event == (
void *)(-1)) {
110 pr_debug(
"failed to mmap %d\n", errno);
118 munmap(event, mmap_len);
120 for (i = 0; i < 2; i++)
static unsigned long flag
void perf_evlist__delete(struct perf_evlist *evlist)
static int sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags)
x86 movsq based memset() in arch/x86/lib/memset_64.S") MEMSET_FN(memset_erms
int parse_events(struct perf_evlist *evlist, const char *str, struct parse_events_error *err)
#define pr_debug(fmt,...)
int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused)
unsigned long perf_event_open_cloexec_flag(void)
static struct perf_evsel * perf_evlist__first(struct perf_evlist *evlist)
struct perf_evlist * perf_evlist__new(void)
struct perf_event_attr attr