Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 1 | #ifndef _PERF_PERF_H |
| 2 | #define _PERF_PERF_H |
| 3 | |
Jiri Olsa | 82baa0e | 2014-05-05 12:58:31 +0200 | [diff] [blame] | 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 |
Jiri Olsa | 43599d1 | 2014-05-05 12:53:20 +0200 | [diff] [blame] | 15 | #include "perf-sys.h" |
Peter Zijlstra | a94d342 | 2013-10-30 11:42:46 +0100 | [diff] [blame] | 16 | |
Thomas Gleixner | a92e70237 | 2009-05-01 18:39:47 +0200 | [diff] [blame] | 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 | } |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 24 | |
Christophe Leroy | 2a19b49 | 2017-09-22 13:20:43 +0200 | [diff] [blame] | 25 | #ifndef MAX_NR_CPUS |
Kyle Meyer | cb993d3 | 2019-06-20 14:36:30 -0500 | [diff] [blame] | 26 | #define MAX_NR_CPUS 2048 |
Christophe Leroy | 2a19b49 | 2017-09-22 13:20:43 +0200 | [diff] [blame] | 27 | #endif |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 28 | |
Feng Tang | 70cb4e9 | 2012-10-30 11:56:02 +0800 | [diff] [blame] | 29 | extern const char *input_name; |
Arnaldo Carvalho de Melo | 8035458 | 2010-05-17 15:51:10 -0300 | [diff] [blame] | 30 | extern bool perf_host, perf_guest; |
Stephane Eranian | fbe96f2 | 2011-09-30 15:40:40 +0200 | [diff] [blame] | 31 | extern const char perf_version_string[]; |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 32 | |
Arnaldo Carvalho de Melo | 3af6e33 | 2011-10-13 08:52:46 -0300 | [diff] [blame] | 33 | void pthread__unblock_sigwinch(void); |
| 34 | |
Namhyung Kim | 12864b3 | 2012-04-26 14:15:22 +0900 | [diff] [blame] | 35 | #include "util/target.h" |
Namhyung Kim | bea0340 | 2012-04-26 14:15:15 +0900 | [diff] [blame] | 36 | |
Arnaldo Carvalho de Melo | b400679 | 2013-12-19 14:43:45 -0300 | [diff] [blame] | 37 | struct record_opts { |
Arnaldo Carvalho de Melo | 602ad87 | 2013-11-12 16:46:16 -0300 | [diff] [blame] | 38 | struct target target; |
Arnaldo Carvalho de Melo | ed80f58 | 2011-11-11 15:12:56 -0200 | [diff] [blame] | 39 | bool group; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 40 | bool inherit_stat; |
Arnaldo Carvalho de Melo | 509051e | 2014-01-14 17:52:14 -0300 | [diff] [blame] | 41 | bool no_buffering; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 42 | bool no_inherit; |
Adrian Hunter | 69e7e5b | 2013-11-18 11:55:57 +0200 | [diff] [blame] | 43 | bool no_inherit_set; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 44 | bool no_samples; |
| 45 | bool raw_samples; |
| 46 | bool sample_address; |
Andi Kleen | 0548429 | 2013-01-24 16:10:29 +0100 | [diff] [blame] | 47 | bool sample_weight; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 48 | bool sample_time; |
Adrian Hunter | 3abebc5 | 2015-07-06 14:51:01 +0300 | [diff] [blame] | 49 | bool sample_time_set; |
Jiri Olsa | b6f35ed | 2016-08-01 20:02:35 +0200 | [diff] [blame] | 50 | bool sample_cpu; |
Andrew Vagin | 3e76ac7 | 2011-12-20 17:32:45 +0300 | [diff] [blame] | 51 | bool period; |
Andi Kleen | 85c273d | 2015-02-24 15:13:40 -0800 | [diff] [blame] | 52 | bool running_time; |
Adrian Hunter | 9e0cc4f | 2015-04-09 18:53:44 +0300 | [diff] [blame] | 53 | bool full_auxtrace; |
Adrian Hunter | d20031b | 2015-04-30 17:37:31 +0300 | [diff] [blame] | 54 | bool auxtrace_snapshot_mode; |
Adrian Hunter | b757bb0 | 2015-07-21 12:44:04 +0300 | [diff] [blame] | 55 | bool record_switch_events; |
Jiri Olsa | 8572388 | 2016-02-15 09:34:31 +0100 | [diff] [blame] | 56 | bool all_kernel; |
| 57 | bool all_user; |
Wang Nan | 4ea648a | 2016-07-14 08:34:47 +0000 | [diff] [blame] | 58 | bool tail_synthesize; |
Wang Nan | 626a6b7 | 2016-07-14 08:34:45 +0000 | [diff] [blame] | 59 | bool overwrite; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 60 | unsigned int freq; |
Arnaldo Carvalho de Melo | 01c2d99 | 2011-11-09 09:16:26 -0200 | [diff] [blame] | 61 | unsigned int mmap_pages; |
Adrian Hunter | 9e0cc4f | 2015-04-09 18:53:44 +0300 | [diff] [blame] | 62 | unsigned int auxtrace_mmap_pages; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 63 | unsigned int user_freq; |
Stephane Eranian | a00dc31 | 2012-05-25 23:13:44 +0200 | [diff] [blame] | 64 | u64 branch_stack; |
Stephane Eranian | bcc84ec | 2015-08-31 18:41:12 +0200 | [diff] [blame] | 65 | u64 sample_intr_regs; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 66 | u64 default_interval; |
| 67 | u64 user_interval; |
Adrian Hunter | d20031b | 2015-04-30 17:37:31 +0300 | [diff] [blame] | 68 | size_t auxtrace_snapshot_size; |
| 69 | const char *auxtrace_snapshot_opts; |
Andi Kleen | 475eeab | 2013-09-20 07:40:43 -0700 | [diff] [blame] | 70 | bool sample_transaction; |
Andi Kleen | 6619a53 | 2014-01-11 13:38:27 -0800 | [diff] [blame] | 71 | unsigned initial_delay; |
Peter Zijlstra | 814c8c3 | 2015-03-31 00:19:31 +0200 | [diff] [blame] | 72 | bool use_clockid; |
| 73 | clockid_t clockid; |
Kan Liang | 9d9cad7 | 2015-06-17 09:51:11 -0400 | [diff] [blame] | 74 | unsigned int proc_map_timeout; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 75 | }; |
| 76 | |
Namhyung Kim | e5b2c20 | 2014-10-23 00:15:46 +0900 | [diff] [blame] | 77 | struct option; |
| 78 | extern const char * const *record_usage; |
| 79 | extern struct option *record_options; |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 80 | #endif |