perf record: Add --buildid-mmap option to enable PERF_RECORD_MMAP2's build id
[linux-2.6-microblaze.git] / tools / perf / util / record.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _PERF_RECORD_H
3 #define _PERF_RECORD_H
4
5 #include <time.h>
6 #include <stdbool.h>
7 #include <linux/types.h>
8 #include <linux/stddef.h>
9 #include <linux/perf_event.h>
10 #include "util/target.h"
11
12 struct option;
13
14 struct record_opts {
15         struct target target;
16         bool          group;
17         bool          inherit_stat;
18         bool          no_buffering;
19         bool          no_inherit;
20         bool          no_inherit_set;
21         bool          no_samples;
22         bool          raw_samples;
23         bool          sample_address;
24         bool          sample_phys_addr;
25         bool          sample_data_page_size;
26         bool          sample_weight;
27         bool          sample_time;
28         bool          sample_time_set;
29         bool          sample_cpu;
30         bool          period;
31         bool          period_set;
32         bool          running_time;
33         bool          full_auxtrace;
34         bool          auxtrace_snapshot_mode;
35         bool          auxtrace_snapshot_on_exit;
36         bool          auxtrace_sample_mode;
37         bool          record_namespaces;
38         bool          record_cgroup;
39         bool          record_switch_events;
40         bool          record_switch_events_set;
41         bool          all_kernel;
42         bool          all_user;
43         bool          kernel_callchains;
44         bool          user_callchains;
45         bool          tail_synthesize;
46         bool          overwrite;
47         bool          ignore_missing_thread;
48         bool          strict_freq;
49         bool          sample_id;
50         bool          no_bpf_event;
51         bool          kcore;
52         bool          text_poke;
53         bool          build_id;
54         unsigned int  freq;
55         unsigned int  mmap_pages;
56         unsigned int  auxtrace_mmap_pages;
57         unsigned int  user_freq;
58         u64           branch_stack;
59         u64           sample_intr_regs;
60         u64           sample_user_regs;
61         u64           default_interval;
62         u64           user_interval;
63         size_t        auxtrace_snapshot_size;
64         const char    *auxtrace_snapshot_opts;
65         const char    *auxtrace_sample_opts;
66         bool          sample_transaction;
67         int           initial_delay;
68         bool          use_clockid;
69         clockid_t     clockid;
70         u64           clockid_res_ns;
71         int           nr_cblocks;
72         int           affinity;
73         int           mmap_flush;
74         unsigned int  comp_level;
75         unsigned int  nr_threads_synthesize;
76         int           ctl_fd;
77         int           ctl_fd_ack;
78         bool          ctl_fd_close;
79 };
80
81 extern const char * const *record_usage;
82 extern struct option *record_options;
83
84 int record__parse_freq(const struct option *opt, const char *str, int unset);
85
86 static inline bool record_opts__no_switch_events(const struct record_opts *opts)
87 {
88         return opts->record_switch_events_set && !opts->record_switch_events;
89 }
90
91 #endif // _PERF_RECORD_H