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 | #ifndef NSEC_PER_SEC |
| 18 | # define NSEC_PER_SEC 1000000000ULL |
| 19 | #endif |
David Ahern | 70f7b4a | 2013-08-07 21:56:38 -0400 | [diff] [blame] | 20 | #ifndef NSEC_PER_USEC |
| 21 | # define NSEC_PER_USEC 1000ULL |
| 22 | #endif |
Thomas Gleixner | a92e70237 | 2009-05-01 18:39:47 +0200 | [diff] [blame] | 23 | |
| 24 | static inline unsigned long long rdclock(void) |
| 25 | { |
| 26 | struct timespec ts; |
| 27 | |
| 28 | clock_gettime(CLOCK_MONOTONIC, &ts); |
| 29 | return ts.tv_sec * 1000000000ULL + ts.tv_nsec; |
| 30 | } |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 31 | |
David Ahern | 4d25576 | 2015-03-24 12:10:38 -0400 | [diff] [blame] | 32 | #define MAX_NR_CPUS 1024 |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 33 | |
Feng Tang | 70cb4e9 | 2012-10-30 11:56:02 +0800 | [diff] [blame] | 34 | extern const char *input_name; |
Arnaldo Carvalho de Melo | 8035458 | 2010-05-17 15:51:10 -0300 | [diff] [blame] | 35 | extern bool perf_host, perf_guest; |
Stephane Eranian | fbe96f2 | 2011-09-30 15:40:40 +0200 | [diff] [blame] | 36 | extern const char perf_version_string[]; |
Zhang, Yanmin | a1645ce | 2010-04-19 13:32:50 +0800 | [diff] [blame] | 37 | |
Arnaldo Carvalho de Melo | 3af6e33 | 2011-10-13 08:52:46 -0300 | [diff] [blame] | 38 | void pthread__unblock_sigwinch(void); |
| 39 | |
Namhyung Kim | 12864b3 | 2012-04-26 14:15:22 +0900 | [diff] [blame] | 40 | #include "util/target.h" |
Namhyung Kim | bea0340 | 2012-04-26 14:15:15 +0900 | [diff] [blame] | 41 | |
Arnaldo Carvalho de Melo | b400679 | 2013-12-19 14:43:45 -0300 | [diff] [blame] | 42 | struct record_opts { |
Arnaldo Carvalho de Melo | 602ad87 | 2013-11-12 16:46:16 -0300 | [diff] [blame] | 43 | struct target target; |
Arnaldo Carvalho de Melo | ed80f58 | 2011-11-11 15:12:56 -0200 | [diff] [blame] | 44 | bool group; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 45 | bool inherit_stat; |
Arnaldo Carvalho de Melo | 509051e | 2014-01-14 17:52:14 -0300 | [diff] [blame] | 46 | bool no_buffering; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 47 | bool no_inherit; |
Adrian Hunter | 69e7e5b | 2013-11-18 11:55:57 +0200 | [diff] [blame] | 48 | bool no_inherit_set; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 49 | bool no_samples; |
| 50 | bool raw_samples; |
| 51 | bool sample_address; |
Andi Kleen | 0548429 | 2013-01-24 16:10:29 +0100 | [diff] [blame] | 52 | bool sample_weight; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 53 | bool sample_time; |
Adrian Hunter | 3abebc5 | 2015-07-06 14:51:01 +0300 | [diff] [blame] | 54 | bool sample_time_set; |
Kan Liang | c421e80 | 2015-07-29 05:42:12 -0400 | [diff] [blame] | 55 | bool callgraph_set; |
Andrew Vagin | 3e76ac7 | 2011-12-20 17:32:45 +0300 | [diff] [blame] | 56 | bool period; |
Stephane Eranian | 6a21c0b | 2014-09-24 13:48:39 +0200 | [diff] [blame] | 57 | bool sample_intr_regs; |
Andi Kleen | 85c273d | 2015-02-24 15:13:40 -0800 | [diff] [blame] | 58 | bool running_time; |
Adrian Hunter | 9e0cc4f | 2015-04-09 18:53:44 +0300 | [diff] [blame] | 59 | bool full_auxtrace; |
Adrian Hunter | d20031b | 2015-04-30 17:37:31 +0300 | [diff] [blame] | 60 | bool auxtrace_snapshot_mode; |
Adrian Hunter | b757bb0 | 2015-07-21 12:44:04 +0300 | [diff] [blame] | 61 | bool record_switch_events; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 62 | unsigned int freq; |
Arnaldo Carvalho de Melo | 01c2d99 | 2011-11-09 09:16:26 -0200 | [diff] [blame] | 63 | unsigned int mmap_pages; |
Adrian Hunter | 9e0cc4f | 2015-04-09 18:53:44 +0300 | [diff] [blame] | 64 | unsigned int auxtrace_mmap_pages; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 65 | unsigned int user_freq; |
Stephane Eranian | a00dc31 | 2012-05-25 23:13:44 +0200 | [diff] [blame] | 66 | u64 branch_stack; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 67 | u64 default_interval; |
| 68 | u64 user_interval; |
Adrian Hunter | d20031b | 2015-04-30 17:37:31 +0300 | [diff] [blame] | 69 | size_t auxtrace_snapshot_size; |
| 70 | const char *auxtrace_snapshot_opts; |
Andi Kleen | 475eeab | 2013-09-20 07:40:43 -0700 | [diff] [blame] | 71 | bool sample_transaction; |
Andi Kleen | 6619a53 | 2014-01-11 13:38:27 -0800 | [diff] [blame] | 72 | unsigned initial_delay; |
Peter Zijlstra | 814c8c3 | 2015-03-31 00:19:31 +0200 | [diff] [blame] | 73 | bool use_clockid; |
| 74 | clockid_t clockid; |
Kan Liang | 9d9cad7 | 2015-06-17 09:51:11 -0400 | [diff] [blame] | 75 | unsigned int proc_map_timeout; |
Arnaldo Carvalho de Melo | 0f82ebc | 2011-11-08 14:41:57 -0200 | [diff] [blame] | 76 | }; |
| 77 | |
Namhyung Kim | e5b2c20 | 2014-10-23 00:15:46 +0900 | [diff] [blame] | 78 | struct option; |
| 79 | extern const char * const *record_usage; |
| 80 | extern struct option *record_options; |
Thomas Gleixner | 6eda583 | 2009-05-01 18:29:57 +0200 | [diff] [blame] | 81 | #endif |