projects/linux·blob master · refs

98 lines · 2.5 KiB

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
12struct option;
13
14struct record_opts {
15 struct target target;
16 bool inherit_stat;
17 bool no_buffering;
18 bool no_inherit;
19 bool no_inherit_set;
20 bool no_samples;
21 bool raw_samples;
22 bool sample_address;
23 bool sample_phys_addr;
24 bool sample_data_page_size;
25 bool sample_code_page_size;
26 bool sample_weight;
27 bool sample_time;
28 bool sample_time_set;
29 bool sample_cpu;
30 bool sample_identifier;
31 bool sample_data_src;
32 bool period;
33 bool period_set;
34 bool running_time;
35 bool full_auxtrace;
36 bool auxtrace_snapshot_mode;
37 bool auxtrace_snapshot_on_exit;
38 bool auxtrace_sample_mode;
39 bool record_namespaces;
40 bool record_cgroup;
41 bool record_switch_events;
42 bool record_switch_events_set;
43 bool record_data_mmap;
44 bool record_data_mmap_set;
45 bool all_kernel;
46 bool all_user;
47 bool kernel_callchains;
48 bool user_callchains;
49 bool tail_synthesize;
50 bool overwrite;
51 bool ignore_missing_thread;
52 bool strict_freq;
53 bool sample_id;
54 bool no_bpf_event;
55 bool kcore;
56 bool text_poke;
57 bool build_id;
58 unsigned int freq;
59 unsigned int mmap_pages;
60 unsigned int auxtrace_mmap_pages;
61 unsigned int user_freq;
62 u64 branch_stack;
63 u64 sample_intr_regs;
64 u64 sample_user_regs;
65 u64 default_interval;
66 u64 user_interval;
67 size_t auxtrace_snapshot_size;
68 const char *auxtrace_snapshot_opts;
69 const char *auxtrace_sample_opts;
70 bool sample_transaction;
71 bool use_clockid;
72 clockid_t clockid;
73 u64 clockid_res_ns;
74 int nr_cblocks;
75 int affinity;
76 int mmap_flush;
77 unsigned int comp_level;
78 unsigned int nr_threads_synthesize;
79 int ctl_fd;
80 int ctl_fd_ack;
81 bool ctl_fd_close;
82 int synth;
83 int threads_spec;
84 const char *threads_user_spec;
85 u64 off_cpu_thresh_ns;
86};
87
88extern const char * const *record_usage;
89extern struct option *record_options;
90
91int record__parse_freq(const struct option *opt, const char *str, int unset);
92
93static inline bool record_opts__no_switch_events(const struct record_opts *opts)
94{
95 return opts->record_switch_events_set && !opts->record_switch_events;
96}
97
98#endif // _PERF_RECORD_H