blob: 510c65f72858fb09fcdad8a5c21ba7bb732747d6 [file] [log] [blame]
Thomas Gleixner6eda5832009-05-01 18:29:57 +02001#ifndef _PERF_PERF_H
2#define _PERF_PERF_H
3
Jiri Olsa82baa0e2014-05-05 12:58:31 +02004#include <time.h>
5#include <stdbool.h>
6#include <linux/types.h>
7#include <linux/perf_event.h>
8
9extern bool test_attr__enabled;
10void test_attr__init(void);
11void 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 Olsa43599d12014-05-05 12:53:20 +020015#include "perf-sys.h"
Peter Zijlstraa94d3422013-10-30 11:42:46 +010016
Thomas Gleixnera92e702372009-05-01 18:39:47 +020017#ifndef NSEC_PER_SEC
18# define NSEC_PER_SEC 1000000000ULL
19#endif
David Ahern70f7b4a2013-08-07 21:56:38 -040020#ifndef NSEC_PER_USEC
21# define NSEC_PER_USEC 1000ULL
22#endif
Thomas Gleixnera92e702372009-05-01 18:39:47 +020023
24static 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 Gleixner6eda5832009-05-01 18:29:57 +020031
Ingo Molnar85a9f922009-05-25 09:59:50 +020032#define MAX_NR_CPUS 256
Thomas Gleixner6eda5832009-05-01 18:29:57 +020033
Feng Tang70cb4e92012-10-30 11:56:02 +080034extern const char *input_name;
Arnaldo Carvalho de Melo80354582010-05-17 15:51:10 -030035extern bool perf_host, perf_guest;
Stephane Eranianfbe96f22011-09-30 15:40:40 +020036extern const char perf_version_string[];
Zhang, Yanmina1645ce2010-04-19 13:32:50 +080037
Arnaldo Carvalho de Melo3af6e332011-10-13 08:52:46 -030038void pthread__unblock_sigwinch(void);
39
Namhyung Kim12864b32012-04-26 14:15:22 +090040#include "util/target.h"
Namhyung Kimbea03402012-04-26 14:15:15 +090041
Arnaldo Carvalho de Melob4006792013-12-19 14:43:45 -030042struct record_opts {
Arnaldo Carvalho de Melo602ad872013-11-12 16:46:16 -030043 struct target target;
Jiri Olsa26d33022012-08-07 15:20:47 +020044 int call_graph;
Jiri Olsaeb853e82014-02-03 12:44:42 +010045 bool call_graph_enabled;
Arnaldo Carvalho de Meloed80f582011-11-11 15:12:56 -020046 bool group;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020047 bool inherit_stat;
Arnaldo Carvalho de Melo509051e2014-01-14 17:52:14 -030048 bool no_buffering;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020049 bool no_inherit;
Adrian Hunter69e7e5b2013-11-18 11:55:57 +020050 bool no_inherit_set;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020051 bool no_samples;
52 bool raw_samples;
53 bool sample_address;
Andi Kleen05484292013-01-24 16:10:29 +010054 bool sample_weight;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020055 bool sample_time;
Andrew Vagin3e76ac72011-12-20 17:32:45 +030056 bool period;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020057 unsigned int freq;
Arnaldo Carvalho de Melo01c2d992011-11-09 09:16:26 -020058 unsigned int mmap_pages;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020059 unsigned int user_freq;
Stephane Eraniana00dc312012-05-25 23:13:44 +020060 u64 branch_stack;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020061 u64 default_interval;
62 u64 user_interval;
Jiri Olsa26d33022012-08-07 15:20:47 +020063 u16 stack_dump_size;
Andi Kleen475eeab2013-09-20 07:40:43 -070064 bool sample_transaction;
Andi Kleen6619a532014-01-11 13:38:27 -080065 unsigned initial_delay;
Arnaldo Carvalho de Melo0f82ebc2011-11-08 14:41:57 -020066};
67
Thomas Gleixner6eda5832009-05-01 18:29:57 +020068#endif