GNU Linux-libre 4.9.309-gnu1
[releases.git] / tools / perf / perf.h
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 #ifndef MAX_NR_CPUS
26 #define MAX_NR_CPUS                     2048
27 #endif
28
29 extern const char *input_name;
30 extern bool perf_host, perf_guest;
31 extern const char perf_version_string[];
32
33 void pthread__unblock_sigwinch(void);
34
35 #include "util/target.h"
36
37 struct record_opts {
38         struct target target;
39         bool         group;
40         bool         inherit_stat;
41         bool         no_buffering;
42         bool         no_inherit;
43         bool         no_inherit_set;
44         bool         no_samples;
45         bool         raw_samples;
46         bool         sample_address;
47         bool         sample_weight;
48         bool         sample_time;
49         bool         sample_time_set;
50         bool         sample_cpu;
51         bool         period;
52         bool         running_time;
53         bool         full_auxtrace;
54         bool         auxtrace_snapshot_mode;
55         bool         record_switch_events;
56         bool         all_kernel;
57         bool         all_user;
58         bool         tail_synthesize;
59         bool         overwrite;
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