23 snprintf(proc_name,
sizeof(proc_name),
"p:%d\n", i);
33 for (i = 0; i < evlist->
nr_mmaps; i++) {
39 const u32 type =
event->header.type;
42 case PERF_RECORD_SAMPLE:
45 case PERF_RECORD_COMM:
49 pr_err(
"Unexpected record of type %d\n", type);
59 int *sample_count,
int *comm_count)
67 str_error_r(errno, sbuf,
sizeof(sbuf)));
83 int ret =
TEST_SKIP,
err, sample_count = 0, comm_count = 0;
95 .default_interval = 1,
98 snprintf(pid,
sizeof(pid),
"%d", getpid());
99 pid[
sizeof(
pid) - 1] =
'\0';
104 pr_debug(
"Not enough memory to create evlist\n");
110 pr_debug(
"Not enough memory to create thread/cpu maps\n");
111 goto out_delete_evlist;
114 bzero(&parse_error,
sizeof(parse_error));
119 err =
parse_events(evlist,
"syscalls:sys_enter_prctl/overwrite/", &parse_error);
121 pr_debug(
"Failed to parse tracepoint event, try use root\n");
123 goto out_delete_evlist;
131 str_error_r(errno, sbuf,
sizeof(sbuf)));
132 goto out_delete_evlist;
139 goto out_delete_evlist;
142 pr_err(
"Unexpected counter: sample_count=%d, comm_count=%d\n",
143 sample_count, comm_count);
144 goto out_delete_evlist;
147 err =
do_test(evlist, 1, &sample_count, &comm_count);
149 goto out_delete_evlist;
int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __maybe_unused)
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
static int do_test(struct perf_evlist *evlist, int mmap_pages, int *sample_count, int *comm_count)
void perf_evlist__enable(struct perf_evlist *evlist)
void perf_evlist__delete(struct perf_evlist *evlist)
static int count_samples(struct perf_evlist *evlist, int *sample_count, int *comm_count)
int parse_events(struct perf_evlist *evlist, const char *str, struct parse_events_error *err)
struct perf_mmap * overwrite_mmap
int perf_mmap__read_init(struct perf_mmap *map)
#define pr_debug(fmt,...)
int perf_evlist__open(struct perf_evlist *evlist)
void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, struct callchain_param *callchain)
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
void perf_mmap__read_done(struct perf_mmap *map)
union perf_event * perf_mmap__read_event(struct perf_mmap *map)
void perf_evlist__disable(struct perf_evlist *evlist)
void perf_evlist__munmap(struct perf_evlist *evlist)
static void testcase(void)
struct perf_evlist * perf_evlist__new(void)