perf.h 1.82 KB
Newer Older
1 2 3
#ifndef _PERF_PERF_H
#define _PERF_PERF_H

4
#include <time.h>
5
#include <stdbool.h>
Borislav Petkov's avatar
Borislav Petkov committed
6
#include <linux/types.h>
7
#include <linux/perf_event.h>
8

9 10 11 12 13 14 15 16
extern bool test_attr__enabled;
void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
		     int fd, int group_fd, unsigned long flags);

#define HAVE_ATTR_TEST
#include "perf-sys.h"

17 18 19 20 21 22 23
static inline unsigned long long rdclock(void)
{
	struct timespec ts;

	clock_gettime(CLOCK_MONOTONIC, &ts);
	return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
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 34
void pthread__unblock_sigwinch(void);

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 45 46
	bool	     no_samples;
	bool	     raw_samples;
	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 57
	bool	     all_kernel;
	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 67
	u64	     default_interval;
	u64	     user_interval;
68 69
	size_t	     auxtrace_snapshot_size;
	const char   *auxtrace_snapshot_opts;
70
	bool	     sample_transaction;
71
	unsigned     initial_delay;
72 73
	bool         use_clockid;
	clockid_t    clockid;
74
	unsigned int proc_map_timeout;
75 76
};

77 78 79
struct option;
extern const char * const *record_usage;
extern struct option *record_options;
80
#endif