Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
6eda5838 TG |
2 | #ifndef _PERF_PERF_H |
3 | #define _PERF_PERF_H | |
4 | ||
1a482f38 | 5 | #include <time.h> |
82baa0eb | 6 | #include <stdbool.h> |
d944c4ee | 7 | #include <linux/types.h> |
44fe619b | 8 | #include <linux/stddef.h> |
d2709c7c | 9 | #include <linux/perf_event.h> |
1a482f38 | 10 | |
82baa0eb | 11 | extern bool test_attr__enabled; |
10213e2f | 12 | void test_attr__ready(void); |
82baa0eb JO |
13 | void test_attr__init(void); |
14 | void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, | |
15 | int fd, int group_fd, unsigned long flags); | |
16 | ||
17 | #define HAVE_ATTR_TEST | |
18 | #include "perf-sys.h" | |
19 | ||
a92e7023 TG |
20 | static inline unsigned long long rdclock(void) |
21 | { | |
22 | struct timespec ts; | |
23 | ||
24 | clock_gettime(CLOCK_MONOTONIC, &ts); | |
25 | return ts.tv_sec * 1000000000ULL + ts.tv_nsec; | |
26 | } | |
6eda5838 | 27 | |
21b8732e | 28 | #ifndef MAX_NR_CPUS |
4d255766 | 29 | #define MAX_NR_CPUS 1024 |
21b8732e | 30 | #endif |
6eda5838 | 31 | |
70cb4e96 | 32 | extern const char *input_name; |
8035458f | 33 | extern bool perf_host, perf_guest; |
fbe96f29 | 34 | extern const char perf_version_string[]; |
a1645ce1 | 35 | |
3af6e338 ACM |
36 | void pthread__unblock_sigwinch(void); |
37 | ||
12864b31 | 38 | #include "util/target.h" |
bea03405 | 39 | |
b4006796 | 40 | struct record_opts { |
602ad878 | 41 | struct target target; |
ed80f581 | 42 | bool group; |
0f82ebc4 | 43 | bool inherit_stat; |
509051ea | 44 | bool no_buffering; |
0f82ebc4 | 45 | bool no_inherit; |
69e7e5b0 | 46 | bool no_inherit_set; |
0f82ebc4 ACM |
47 | bool no_samples; |
48 | bool raw_samples; | |
49 | bool sample_address; | |
3b0a5daa | 50 | bool sample_phys_addr; |
05484298 | 51 | bool sample_weight; |
0f82ebc4 | 52 | bool sample_time; |
3abebc55 | 53 | bool sample_time_set; |
b6f35ed7 | 54 | bool sample_cpu; |
3e76ac78 | 55 | bool period; |
f290aa1f | 56 | bool period_set; |
85c273d2 | 57 | bool running_time; |
9e0cc4fe | 58 | bool full_auxtrace; |
d20031bb | 59 | bool auxtrace_snapshot_mode; |
f3b3614a | 60 | bool record_namespaces; |
b757bb09 | 61 | bool record_switch_events; |
85723885 JO |
62 | bool all_kernel; |
63 | bool all_user; | |
4ea648ae | 64 | bool tail_synthesize; |
626a6b78 | 65 | bool overwrite; |
a359c17a | 66 | bool ignore_missing_thread; |
b09c2364 | 67 | bool strict_freq; |
ad46e48c | 68 | bool sample_id; |
0f82ebc4 | 69 | unsigned int freq; |
01c2d99b | 70 | unsigned int mmap_pages; |
9e0cc4fe | 71 | unsigned int auxtrace_mmap_pages; |
0f82ebc4 | 72 | unsigned int user_freq; |
a00dc319 | 73 | u64 branch_stack; |
bcc84ec6 | 74 | u64 sample_intr_regs; |
84c41742 | 75 | u64 sample_user_regs; |
0f82ebc4 ACM |
76 | u64 default_interval; |
77 | u64 user_interval; | |
d20031bb AH |
78 | size_t auxtrace_snapshot_size; |
79 | const char *auxtrace_snapshot_opts; | |
475eeab9 | 80 | bool sample_transaction; |
6619a53e | 81 | unsigned initial_delay; |
814c8c38 PZ |
82 | bool use_clockid; |
83 | clockid_t clockid; | |
cf790516 | 84 | u64 clockid_res_ns; |
d3d1af6f | 85 | int nr_cblocks; |
0f82ebc4 ACM |
86 | }; |
87 | ||
e5b2c207 NK |
88 | struct option; |
89 | extern const char * const *record_usage; | |
90 | extern struct option *record_options; | |
3aa94b10 | 91 | extern int version_verbose; |
67230479 ACM |
92 | |
93 | int record__parse_freq(const struct option *opt, const char *str, int unset); | |
6eda5838 | 94 | #endif |