xref: /openbmc/linux/tools/perf/perf.h (revision a36954f5)
1 #ifndef _PERF_PERF_H
2 #define _PERF_PERF_H
3 
4 #include <time.h>
5 #include <stdbool.h>
6 #include <linux/types.h>
7 #include <linux/perf_event.h>
8 
9 extern bool test_attr__enabled;
10 void test_attr__init(void);
11 void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
12 		     int fd, int group_fd, unsigned long flags);
13 
14 #define HAVE_ATTR_TEST
15 #include "perf-sys.h"
16 
17 static inline unsigned long long rdclock(void)
18 {
19 	struct timespec ts;
20 
21 	clock_gettime(CLOCK_MONOTONIC, &ts);
22 	return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
23 }
24 
25 #define MAX_NR_CPUS			1024
26 
27 extern const char *input_name;
28 extern bool perf_host, perf_guest;
29 extern const char perf_version_string[];
30 
31 void pthread__unblock_sigwinch(void);
32 
33 #include "util/target.h"
34 
35 struct record_opts {
36 	struct target target;
37 	bool	     group;
38 	bool	     inherit_stat;
39 	bool	     no_buffering;
40 	bool	     no_inherit;
41 	bool	     no_inherit_set;
42 	bool	     no_samples;
43 	bool	     raw_samples;
44 	bool	     sample_address;
45 	bool	     sample_weight;
46 	bool	     sample_time;
47 	bool	     sample_time_set;
48 	bool	     sample_cpu;
49 	bool	     period;
50 	bool	     running_time;
51 	bool	     full_auxtrace;
52 	bool	     auxtrace_snapshot_mode;
53 	bool	     record_namespaces;
54 	bool	     record_switch_events;
55 	bool	     all_kernel;
56 	bool	     all_user;
57 	bool	     tail_synthesize;
58 	bool	     overwrite;
59 	bool	     ignore_missing_thread;
60 	unsigned int freq;
61 	unsigned int mmap_pages;
62 	unsigned int auxtrace_mmap_pages;
63 	unsigned int user_freq;
64 	u64          branch_stack;
65 	u64	     sample_intr_regs;
66 	u64	     default_interval;
67 	u64	     user_interval;
68 	size_t	     auxtrace_snapshot_size;
69 	const char   *auxtrace_snapshot_opts;
70 	bool	     sample_transaction;
71 	unsigned     initial_delay;
72 	bool         use_clockid;
73 	clockid_t    clockid;
74 	unsigned int proc_map_timeout;
75 };
76 
77 struct option;
78 extern const char * const *record_usage;
79 extern struct option *record_options;
80 #endif
81