10 #include <api/fs/fs.h> 26 #include <subcmd/parse-options.h> 29 #include <sys/ioctl.h> 32 #include <linux/bitops.h> 33 #include <linux/hash.h> 34 #include <linux/log2.h> 35 #include <linux/err.h> 37 #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) 38 #define SID(e, x, y) xyarray__entry(e->sample_id, x, y) 46 INIT_HLIST_HEAD(&evlist->
heads[i]);
47 INIT_LIST_HEAD(&evlist->
entries);
49 fdarray__init(&evlist->
pollfd, 64);
118 list_del_init(&pos->
node);
130 fdarray__exit(&evlist->
pollfd);
192 list_del_init(&evsel->
node);
197 struct list_head *list)
202 list_del_init(&evsel->
node);
231 attr->precise_ip = 3;
233 while (attr->precise_ip != 0) {
256 struct perf_event_attr attr = {
257 .type = PERF_TYPE_SOFTWARE,
258 .config = PERF_COUNT_SW_DUMMY,
259 .size =
sizeof(attr),
271 struct perf_event_attr *attrs,
size_t nr_attrs)
277 for (i = 0; i < nr_attrs; i++) {
280 goto out_delete_partial_list;
281 list_add_tail(&evsel->
node, &head);
288 out_delete_partial_list:
295 struct perf_event_attr *attrs,
size_t nr_attrs)
299 for (i = 0; i < nr_attrs; i++)
311 if (evsel->
attr.type == PERF_TYPE_TRACEPOINT &&
312 (
int)evsel->
attr.config ==
id)
326 if ((evsel->
attr.type == PERF_TYPE_TRACEPOINT) &&
327 (strcmp(evsel->
name, name) == 0))
396 for (thread = 0; thread < nr_threads; thread++) {
397 int err = ioctl(
FD(evsel, cpu, thread), PERF_EVENT_IOC_ENABLE, 0);
414 for (cpu = 0; cpu < nr_cpus; cpu++) {
415 int err = ioctl(
FD(evsel, cpu, thread), PERF_EVENT_IOC_ENABLE, 0);
444 nfds += nr_cpus * nr_threads;
447 if (fdarray__available_entries(&evlist->
pollfd) < nfds &&
448 fdarray__grow(&evlist->
pollfd, nfds) < 0)
457 int pos = fdarray__add(&evlist->
pollfd, fd, revent | POLLERR | POLLHUP);
463 evlist->
pollfd.priv[pos].ptr = map;
465 fcntl(fd, F_SETFL, O_NONBLOCK);
477 void *arg __maybe_unused)
487 return fdarray__filter(&evlist->
pollfd, revents_and_mask,
493 return fdarray__poll(&evlist->
pollfd, timeout);
498 int cpu,
int thread, u64
id)
506 hlist_add_head(&sid->
node, &evlist->
heads[hash]);
520 u64 read_data[4] = { 0, };
525 ret = ioctl(fd, PERF_EVENT_IOC_ID, &
id);
541 if (!(evsel->
attr.read_format & PERF_FORMAT_ID) ||
542 read(fd, &read_data,
sizeof(read_data)) == -1)
545 if (evsel->
attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
547 if (evsel->
attr.read_format & PERF_FORMAT_TOTAL_TIME_RUNNING)
550 id = read_data[id_idx];
563 if (evlist->
cpus && cpu >= 0)
575 struct hlist_head *head;
580 head = &evlist->
heads[hash];
582 hlist_for_each_entry(sid, head,
node)
624 const u64 *
array =
event->sample.array;
627 n = (
event->header.size -
sizeof(
event->header)) >> 3;
629 if (event->
header.type == PERF_RECORD_SAMPLE) {
632 *
id = array[evlist->
id_pos];
646 struct hlist_head *head;
654 if (!first->
attr.sample_id_all &&
655 event->
header.type != PERF_RECORD_SAMPLE)
666 head = &evlist->
heads[hash];
668 hlist_for_each_entry(sid, head,
node) {
682 for (i = 0; i < evlist->
nr_mmaps; i++) {
688 err = ioctl(fd, PERF_EVENT_IOC_PAUSE_OUTPUT, value ? 1 : 0);
710 for (i = 0; i < evlist->
nr_mmaps; i++)
714 for (i = 0; i < evlist->
nr_mmaps; i++)
738 for (i = 0; i < evlist->
nr_mmaps; i++) {
750 refcount_set(&map[i].
refcnt, 0);
759 if (evsel->
attr.write_backward)
766 int thread,
int *_output,
int *_output_overwrite)
778 mp->
prot = PROT_READ | PROT_WRITE;
779 if (evsel->
attr.write_backward) {
780 output = _output_overwrite;
791 mp->
prot &= ~PROT_WRITE;
801 fd =
FD(evsel, cpu, thread);
809 if (ioctl(fd, PERF_EVENT_IOC_SET_OUTPUT, *output) != 0)
830 if (evsel->
attr.read_format & PERF_FORMAT_ID) {
849 pr_debug2(
"perf event ring buffer mmapped per cpu\n");
850 for (cpu = 0; cpu < nr_cpus; cpu++) {
852 int output_overwrite = -1;
857 for (thread = 0; thread < nr_threads; thread++) {
859 thread, &output, &output_overwrite))
877 pr_debug2(
"perf event ring buffer mmapped per thread\n");
878 for (thread = 0; thread < nr_threads; thread++) {
880 int output_overwrite = -1;
886 &output, &output_overwrite))
902 if (sysctl__read_int(
"kernel/perf_event_mlock_kb", &max) < 0) {
914 if (!is_power_of_2(pages))
915 pages = rounddown_pow_of_two(pages);
922 if (pages == UINT_MAX)
924 else if (!is_power_of_2(pages))
933 unsigned long pages, val;
935 { .
tag =
'B', .mult = 1 },
936 { .tag =
'K', .mult = 1 << 10 },
937 { .tag =
'M', .mult = 1 << 20 },
938 { .tag =
'G', .mult = 1 << 30 },
946 if (val != (
unsigned long) -1) {
952 pages = strtoul(str, &eptr, 10);
957 if (pages == 0 && min == 0) {
959 }
else if (!is_power_of_2(pages)) {
963 pages = roundup_pow_of_two(pages);
968 pr_info(
"rounding mmap pages size to %s (%lu pages)\n",
980 unsigned long max = UINT_MAX;
988 pr_err(
"Invalid argument for --mmap_pages/-m\n");
997 int unset __maybe_unused)
1020 unsigned int auxtrace_pages,
1021 bool auxtrace_overwrite)
1046 auxtrace_pages, auxtrace_overwrite);
1049 if ((evsel->
attr.read_format & PERF_FORMAT_ID) &&
1102 goto out_delete_threads;
1125 if (cpus != evlist->
cpus) {
1130 if (threads != evlist->
threads) {
1139 enum perf_event_sample_format bit)
1148 enum perf_event_sample_format bit)
1162 if (evsel->
filter == NULL)
1185 if (evsel->
attr.type != PERF_TYPE_TRACEPOINT)
1202 for (i = 0; i < npids; ++i) {
1204 if (asprintf(&filter,
"common_pid != %d", pids[i]) < 0)
1209 if (asprintf(&tmp,
"%s && common_pid != %d", filter, pids[i]) < 0)
1272 branch_type |= evsel->
attr.branch_sample_type;
1279 u64 read_format = first->
attr.read_format;
1280 u64 sample_type = first->
attr.sample_type;
1283 if (read_format != pos->attr.read_format)
1288 if ((sample_type & PERF_SAMPLE_READ) &&
1289 !(read_format & PERF_FORMAT_ID)) {
1299 return first->
attr.read_format;
1309 if (!first->
attr.sample_id_all)
1312 sample_type = first->
attr.sample_type;
1314 if (sample_type & PERF_SAMPLE_TID)
1315 size +=
sizeof(data->
tid) * 2;
1317 if (sample_type & PERF_SAMPLE_TIME)
1318 size +=
sizeof(data->
time);
1320 if (sample_type & PERF_SAMPLE_ID)
1321 size +=
sizeof(data->
id);
1323 if (sample_type & PERF_SAMPLE_STREAM_ID)
1326 if (sample_type & PERF_SAMPLE_CPU)
1327 size +=
sizeof(data->
cpu) * 2;
1329 if (sample_type & PERF_SAMPLE_IDENTIFIER)
1330 size +=
sizeof(data->
id);
1340 if (first->
attr.sample_id_all != pos->attr.sample_id_all)
1350 return first->
attr.sample_id_all;
1407 if (evlist->
threads == NULL && evlist->
cpus == NULL) {
1429 const char *argv[],
bool pipe_output,
1430 void (*exec_error)(
int signo, siginfo_t *info,
void *ucontext))
1432 int child_ready_pipe[2], go_pipe[2];
1435 if (pipe(child_ready_pipe) < 0) {
1436 perror(
"failed to create 'ready' pipe");
1440 if (pipe(go_pipe) < 0) {
1441 perror(
"failed to create 'go' pipe");
1442 goto out_close_ready_pipe;
1447 perror(
"failed to fork");
1448 goto out_close_pipes;
1457 signal(SIGTERM, SIG_DFL);
1459 close(child_ready_pipe[0]);
1461 fcntl(go_pipe[0], F_SETFD, FD_CLOEXEC);
1466 close(child_ready_pipe[1]);
1471 ret = read(go_pipe[0], &bf, 1);
1484 perror(
"unable to read pipe");
1488 execvp(argv[0], (
char **)argv);
1493 val.sival_int = errno;
1494 if (sigqueue(getppid(), SIGUSR1, val))
1502 struct sigaction act = {
1503 .sa_flags = SA_SIGINFO,
1504 .sa_sigaction = exec_error,
1506 sigaction(SIGUSR1, &act, NULL);
1510 if (evlist->
threads == NULL) {
1511 fprintf(stderr,
"FATAL: evlist->threads need to be set at this point (%s:%d).\n",
1512 __func__, __LINE__);
1513 goto out_close_pipes;
1518 close(child_ready_pipe[1]);
1523 if (read(child_ready_pipe[0], &bf, 1) == -1) {
1524 perror(
"unable to read pipe");
1525 goto out_close_pipes;
1528 fcntl(go_pipe[1], F_SETFD, FD_CLOEXEC);
1530 close(child_ready_pipe[0]);
1536 out_close_ready_pipe:
1537 close(child_ready_pipe[0]);
1538 close(child_ready_pipe[1]);
1552 perror(
"unable to write to pipe");
1588 printed += fprintf(fp,
"%s%s", evsel->
idx ?
", " :
"",
1592 return printed + fprintf(fp,
"\n");
1596 int err,
char *buf,
size_t size)
1599 char sbuf[
STRERR_BUFSIZE], *emsg = str_error_r(err, sbuf,
sizeof(sbuf));
1604 printed = scnprintf(buf, size,
1606 "Hint:\tCheck /proc/sys/kernel/perf_event_paranoid setting.", emsg);
1610 printed += scnprintf(buf + printed, size - printed,
"\nHint:\t");
1613 printed += scnprintf(buf + printed, size - printed,
1614 "For your workloads it needs to be <= 1\nHint:\t");
1616 printed += scnprintf(buf + printed, size - printed,
1617 "For system wide tracing it needs to be set to -1.\n");
1619 printed += scnprintf(buf + printed, size - printed,
1620 "Hint:\tTry: 'sudo sh -c \"echo -1 > /proc/sys/kernel/perf_event_paranoid\"'\n" 1621 "Hint:\tThe current value is %d.", value);
1627 if (sysctl__read_int(
"kernel/perf_event_max_sample_rate", &max_freq) < 0)
1630 if (first->
attr.sample_freq < (u64)max_freq)
1633 printed = scnprintf(buf, size,
1635 "Hint:\tCheck /proc/sys/kernel/perf_event_max_sample_rate.\n" 1636 "Hint:\tThe current value is %d and %" PRIu64
" is being requested.",
1637 emsg, max_freq, first->
attr.sample_freq);
1642 scnprintf(buf, size,
"%s", emsg);
1651 char sbuf[
STRERR_BUFSIZE], *emsg = str_error_r(err, sbuf,
sizeof(sbuf));
1652 int pages_attempted = evlist->
mmap_len / 1024, pages_max_per_user, printed = 0;
1656 sysctl__read_int(
"kernel/perf_event_mlock_kb", &pages_max_per_user);
1657 printed += scnprintf(buf + printed, size - printed,
1659 "Hint:\tCheck /proc/sys/kernel/perf_event_mlock_kb (%d kB) setting.\n" 1660 "Hint:\tTried using %zd kB.\n",
1661 emsg, pages_max_per_user, pages_attempted);
1663 if (pages_attempted >= pages_max_per_user) {
1664 printed += scnprintf(buf + printed, size - printed,
1665 "Hint:\tTry 'sudo sh -c \"echo %d > /proc/sys/kernel/perf_event_mlock_kb\"', or\n",
1666 pages_max_per_user + pages_attempted);
1669 printed += scnprintf(buf + printed, size - printed,
1670 "Hint:\tTry using a smaller -m/--mmap-pages value.");
1673 scnprintf(buf, size,
"%s", emsg);
1691 list_move_tail(&evsel->
node, &move);
1694 list_splice(&move, &evlist->
entries);
1706 if (evsel != tracking_evsel)
1722 if (strcmp(str, evsel->
name) == 0)
1742 switch (old_state) {
1766 WARN_ONCE(1,
"Shouldn't get there\n");
1792 if (!evsel->
attr.exclude_kernel)
static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads)
void event_attr_init(struct perf_event_attr *attr)
void perf_evlist__exit(struct perf_evlist *evlist)
int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *target, const char *argv[], bool pipe_output, void(*exec_error)(int signo, siginfo_t *info, void *ucontext))
struct perf_evlist::@110 workload
bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist)
void perf_evlist__set_leader(struct perf_evlist *evlist)
bool perf_evlist__valid_sample_type(struct perf_evlist *evlist)
struct thread_map * thread_map__new_dummy(void)
void perf_evlist__set_id_pos(struct perf_evlist *evlist)
bool perf_evlist__valid_read_format(struct perf_evlist *evlist)
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
void perf_mmap__put(struct perf_mmap *map)
static LIST_HEAD(page_alloc_sort_input)
struct cpu_map * cpu_map__dummy_new(void)
static int cpu_map__nr(const struct cpu_map *map)
struct perf_evlist * perf_evlist__new_default(void)
struct perf_evsel * perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
int cpu_map__idx(struct cpu_map *cpus, int cpu)
struct xyarray * sample_id
int perf_evsel__parse_sample_timestamp(struct perf_evsel *evsel, union perf_event *event, u64 *timestamp)
void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
void perf_evlist__enable(struct perf_evlist *evlist)
int __perf_evlist__add_default(struct perf_evlist *evlist, bool precise)
struct thread_map * thread_map__new_str(const char *pid, const char *tid, uid_t uid, bool all_threads)
struct perf_evsel * perf_evlist__id2evsel_strict(struct perf_evlist *evlist, u64 id)
static int perf_evlist__event2id(struct perf_evlist *evlist, union perf_event *event, u64 *id)
struct thread_map * thread_map__get(struct thread_map *map)
static int perf_evlist__resume(struct perf_evlist *evlist)
void perf_mmap__get(struct perf_mmap *map)
static void perf_evlist__purge(struct perf_evlist *evlist)
void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel, enum perf_event_sample_format bit)
bool perf_evlist__exclude_kernel(struct perf_evlist *evlist)
static int perf_evlist__pause(struct perf_evlist *evlist)
bool perf_evlist__sample_id_all(struct perf_evlist *evlist)
int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter)
int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid)
static int perf_evlist__add_attrs(struct perf_evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs)
static void thread_map__set_pid(struct thread_map *map, int thread, pid_t pid)
#define pr_debug2(fmt,...)
#define evlist__for_each_entry_reverse(evlist, evsel)
static int perf_evlist__enable_event_thread(struct perf_evlist *evlist, struct perf_evsel *evsel, int thread)
struct perf_evsel * perf_evlist__event2evsel(struct perf_evlist *evlist, union perf_event *event)
void perf_evsel__delete(struct perf_evsel *evsel)
void perf_evlist__delete(struct perf_evlist *evlist)
void perf_evlist__remove(struct perf_evlist *evlist, struct perf_evsel *evsel)
void perf_evlist__splice_list_tail(struct perf_evlist *evlist, struct list_head *list)
static int perf_evlist__enable_event_cpu(struct perf_evlist *evlist, struct perf_evsel *evsel, int cpu)
static int sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags)
int perf_evlist__start_workload(struct perf_evlist *evlist)
int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, unsigned int auxtrace_pages, bool auxtrace_overwrite)
struct thread_map * threads
int perf_evsel__disable(struct perf_evsel *evsel)
static bool target__none(struct target *target)
struct perf_evlist * perf_evlist__new_dummy(void)
int perf_evlist__add_newtp(struct perf_evlist *evlist, const char *sys, const char *name, void *handler)
#define PERF_EVLIST__HLIST_SIZE
static void perf_evlist__set_sid_idx(struct perf_evlist *evlist, struct perf_evsel *evsel, int idx, int cpu, int thread)
static int perf_evlist__mmap_per_cpu(struct perf_evlist *evlist, struct mmap_params *mp)
int perf_evlist__add_dummy(struct perf_evlist *evlist)
int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str, int unset __maybe_unused)
int __perf_evlist__parse_mmap_pages(unsigned int *mmap_pages, const char *str)
struct perf_mmap * overwrite_mmap
u64 perf_evlist__combined_sample_type(struct perf_evlist *evlist)
#define evlist__for_each_entry_safe(evlist, tmp, evsel)
void perf_evlist__set_selected(struct perf_evlist *evlist, struct perf_evsel *evsel)
void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, enum perf_event_sample_format bit)
void cpu_map__put(struct cpu_map *map)
void perf_evlist__set_tracking_event(struct perf_evlist *evlist, struct perf_evsel *tracking_evsel)
void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel, int cpu, int thread, u64 id)
struct hlist_head heads[PERF_EVLIST__HLIST_SIZE]
static void perf_evlist__update_id_pos(struct perf_evlist *evlist)
static int __perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, struct perf_mmap *map, short revent)
int perf_evlist__poll(struct perf_evlist *evlist, int timeout)
struct perf_evlist * evlist
#define pr_debug(fmt,...)
static int perf_evlist__nr_threads(struct perf_evlist *evlist, struct perf_evsel *evsel)
int perf_evlist__open(struct perf_evlist *evlist)
#define evlist__for_each_entry(evlist, evsel)
int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel)
int perf_evsel__set_filter(struct perf_evsel *evsel, const char *filter)
int perf_evlist__parse_sample(struct perf_evlist *evlist, union perf_event *event, struct perf_sample *sample)
static bool cpu_map__empty(const struct cpu_map *map)
static int entry(u64 ip, struct unwind_info *ui)
int perf_evlist__strerror_mmap(struct perf_evlist *evlist, int err, char *buf, size_t size)
int cpu_map__cpu(struct cpu_map *cpus, int idx)
int perf_evlist__id_add_fd(struct perf_evlist *evlist, struct perf_evsel *evsel, int cpu, int thread, int fd)
static struct perf_mmap * perf_evlist__alloc_mmap(struct perf_evlist *evlist, bool overwrite)
void perf_evlist__toggle_bkw_mmap(struct perf_evlist *evlist, enum bkw_mmap_state state)
int perf_mmap__mmap(struct perf_mmap *map, struct mmap_params *mp, int fd)
static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd, void *arg __maybe_unused)
static int str(yyscan_t scanner, int token)
struct perf_evsel * perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
#define __evlist__for_each_entry(list, evsel)
int perf_evlist__parse_sample_timestamp(struct perf_evlist *evlist, union perf_event *event, u64 *timestamp)
int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids)
static int perf_evlist__set_paused(struct perf_evlist *evlist, bool value)
u16 perf_evlist__id_hdr_size(struct perf_evlist *evlist)
void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry)
void perf_evsel__close(struct perf_evsel *evsel)
void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, struct perf_evlist *evlist, int idx, bool per_cpu)
int unit_number__scnprintf(char *buf, size_t size, u64 n)
void perf_evlist__to_front(struct perf_evlist *evlist, struct perf_evsel *move_evsel)
unsigned long parse_tag_value(const char *str, struct parse_tag *tags)
size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp)
int perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd)
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
struct cpu_map * own_cpus
struct thread_map * threads
int perf_event_paranoid(void)
#define evlist__for_each_entry_continue(evlist, evsel)
static void perf_evlist__munmap_nofree(struct perf_evlist *evlist)
#define PERF_EVLIST__HLIST_BITS
void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, enum perf_event_sample_format bit)
u64 perf_evlist__read_format(struct perf_evlist *evlist)
void perf_evsel__calc_id_pos(struct perf_evsel *evsel)
const char * perf_evsel__name(struct perf_evsel *evsel)
static struct thread_data threads[THREADS]
static int thread_map__nr(struct thread_map *threads)
struct perf_event_header header
void perf_mmap__munmap(struct perf_mmap *map)
int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads)
static int perf_evlist__mmap_per_thread(struct perf_evlist *evlist, struct mmap_params *mp)
struct strfilter * filter
void perf_event_attr__set_max_precise_ip(struct perf_event_attr *attr)
void __perf_evlist__set_leader(struct list_head *list)
struct perf_evsel * selected
static struct @9 output[OUTPUT_TYPE_MAX]
static struct perf_evsel * perf_evlist__first(struct perf_evlist *evlist)
void perf_evlist__force_leader(struct perf_evlist *evlist)
enum bkw_mmap_state bkw_mmap_state
static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist)
void perf_evlist__disable(struct perf_evlist *evlist)
void perf_evlist__munmap(struct perf_evlist *evlist)
u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist)
void perf_evlist__toggle_enable(struct perf_evlist *evlist)
static void __perf_evlist__propagate_maps(struct perf_evlist *evlist, struct perf_evsel *evsel)
struct perf_evsel * leader
struct auxtrace_mmap_params auxtrace_mp
int perf_evlist__filter_pollfd(struct perf_evlist *evlist, short revents_and_mask)
int perf_evsel__enable(struct perf_evsel *evsel)
struct perf_evsel * perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, const char *name)
size_t perf_evlist__mmap_size(unsigned long pages)
u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist)
int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter)
void perf_evlist__close(struct perf_evlist *evlist)
static long parse_pages_arg(const char *str, unsigned long min, unsigned long max)
static pid_t thread_map__pid(struct thread_map *map, int thread)
unsigned long perf_event_mlock_kb_in_pages(void)
void thread_map__put(struct thread_map *map)
struct perf_evsel * perf_evsel__new_cycles(bool precise)
static bool perf_evsel__is_group_leader(const struct perf_evsel *evsel)
int __perf_evlist__add_default_attrs(struct perf_evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs)
void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads)
static bool target__uses_dummy_map(struct target *target)
static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx, struct mmap_params *mp, int cpu_idx, int thread, int *_output, int *_output_overwrite)
#define __evlist__for_each_entry_safe(list, tmp, evsel)
int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, struct perf_sample *data)
struct perf_evsel * evsel
static struct perf_evsel * perf_evsel__newtp(const char *sys, const char *name)
struct perf_evsel * perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id)
int perf_evlist__strerror_open(struct perf_evlist *evlist, int err, char *buf, size_t size)
struct cpu_map * cpu_map__new(const char *cpu_list)
static void perf_evlist__id_hash(struct perf_evlist *evlist, struct perf_evsel *evsel, int cpu, int thread, u64 id)
struct perf_sample_id * perf_evlist__id2sid(struct perf_evlist *evlist, u64 id)
static int perf_evlist__add_default(struct perf_evlist *evlist)
int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp, off_t auxtrace_offset, unsigned int auxtrace_pages, bool auxtrace_overwrite)
static bool perf_evlist__should_poll(struct perf_evlist *evlist __maybe_unused, struct perf_evsel *evsel)
struct perf_evsel * perf_evlist__find_evsel_by_str(struct perf_evlist *evlist, const char *str)
struct perf_evlist * perf_evlist__new(void)
struct perf_event_attr attr
int perf_evlist__enable_event_idx(struct perf_evlist *evlist, struct perf_evsel *evsel, int idx)
struct cpu_map * cpu_map__get(struct cpu_map *map)
void static void * zalloc(size_t size)