15 #define O_DIRECTORY 00200000 33 const char *
filename =
"/etc/passwd";
37 int err = -1, i, nr_events = 0, nr_polls = 0;
41 pr_debug(
"%s: perf_evlist__new\n", __func__);
47 pr_debug(
"%s: perf_evsel__newtp\n", __func__);
48 goto out_delete_evlist;
55 pr_debug(
"%s: perf_evlist__create_maps\n", __func__);
56 goto out_delete_evlist;
66 str_error_r(errno, sbuf,
sizeof(sbuf)));
67 goto out_delete_evlist;
73 str_error_r(errno, sbuf,
sizeof(sbuf)));
74 goto out_delete_evlist;
85 int before = nr_events;
87 for (i = 0; i < evlist->
nr_mmaps; i++) {
91 md = &evlist->
mmap[i];
96 const u32 type =
event->header.type;
102 if (type != PERF_RECORD_SAMPLE) {
109 pr_debug(
"Can't parse sample, err = %d\n", err);
110 goto out_delete_evlist;
115 if (flags != tp_flags) {
116 pr_debug(
"%s: Expected flags=%#x, got %#x\n",
117 __func__, flags, tp_flags);
118 goto out_delete_evlist;
126 if (nr_events == before)
129 if (++nr_polls > 5) {
130 pr_debug(
"%s: no events!\n", __func__);
131 goto out_delete_evlist;
void perf_mmap__consume(struct perf_mmap *map)
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
void perf_evlist__enable(struct perf_evlist *evlist)
static void thread_map__set_pid(struct thread_map *map, int thread, pid_t pid)
void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
void perf_evlist__delete(struct perf_evlist *evlist)
struct thread_map * threads
int perf_mmap__read_init(struct perf_mmap *map)
int perf_evlist__poll(struct perf_evlist *evlist, int timeout)
#define pr_debug(fmt,...)
int perf_evlist__open(struct perf_evlist *evlist)
void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry)
u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
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)
int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, struct perf_sample *data)
static struct perf_evsel * perf_evsel__newtp(const char *sys, const char *name)
int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest __maybe_unused)
struct perf_evlist * perf_evlist__new(void)