xref: /openbmc/linux/tools/perf/perf.h (revision e5c86679)
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_switch_events;
54 	bool	     all_kernel;
55 	bool	     all_user;
56 	bool	     tail_synthesize;
57 	bool	     overwrite;
58 	bool	     ignore_missing_thread;
59 	unsigned int freq;
60 	unsigned int mmap_pages;
61 	unsigned int auxtrace_mmap_pages;
62 	unsigned int user_freq;
63 	u64          branch_stack;
64 	u64	     sample_intr_regs;
65 	u64	     default_interval;
66 	u64	     user_interval;
67 	size_t	     auxtrace_snapshot_size;
68 	const char   *auxtrace_snapshot_opts;
69 	bool	     sample_transaction;
70 	unsigned     initial_delay;
71 	bool         use_clockid;
72 	clockid_t    clockid;
73 	unsigned int proc_map_timeout;
74 };
75 
76 struct option;
77 extern const char * const *record_usage;
78 extern struct option *record_options;
79 #endif
80