Linux Perf
perf.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _PERF_PERF_H
3 #define _PERF_PERF_H
4 
5 #include <time.h>
6 #include <stdbool.h>
7 #include <linux/types.h>
8 #include <linux/perf_event.h>
9 
10 extern bool test_attr__enabled;
11 void test_attr__ready(void);
12 void test_attr__init(void);
13 void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
14  int fd, int group_fd, unsigned long flags);
15 
16 #define HAVE_ATTR_TEST
17 #include "perf-sys.h"
18 
19 static inline unsigned long long rdclock(void)
20 {
21  struct timespec ts;
22 
23  clock_gettime(CLOCK_MONOTONIC, &ts);
24  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
25 }
26 
27 #define MAX_NR_CPUS 1024
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;
42  bool no_inherit;
44  bool no_samples;
51  bool sample_cpu;
52  bool period;
53  bool period_set;
59  bool all_kernel;
60  bool all_user;
62  bool overwrite;
65  bool sample_id;
66  unsigned int freq;
67  unsigned int mmap_pages;
68  unsigned int auxtrace_mmap_pages;
69  unsigned int user_freq;
78  unsigned initial_delay;
80  clockid_t clockid;
81  unsigned int proc_map_timeout;
82 };
83 
84 struct option;
85 extern const char * const *record_usage;
86 extern struct option *record_options;
87 extern int version_verbose;
88 
89 int record__parse_freq(const struct option *opt, const char *str, int unset);
90 #endif
bool perf_host
Definition: util.c:80
size_t auxtrace_snapshot_size
Definition: perf.h:75
u64 user_interval
Definition: perf.h:74
bool test_attr__enabled
Definition: util.c:78
bool group
Definition: perf.h:39
bool no_samples
Definition: perf.h:44
void test_attr__ready(void)
Definition: attr.c:158
const char perf_version_string[]
Definition: header.c:60
const char *const * record_usage
bool full_auxtrace
Definition: perf.h:55
bool record_namespaces
Definition: perf.h:57
unsigned int proc_map_timeout
Definition: perf.h:81
const char * auxtrace_snapshot_opts
Definition: perf.h:76
bool sample_cpu
Definition: perf.h:51
bool no_inherit_set
Definition: perf.h:43
struct option * record_options
bool tail_synthesize
Definition: perf.h:61
bool no_buffering
Definition: perf.h:41
bool sample_time
Definition: perf.h:49
void pthread__unblock_sigwinch(void)
Definition: perf.c:414
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, int fd, int group_fd, unsigned long flags)
Definition: attr.c:145
static unsigned long long rdclock(void)
Definition: perf.h:19
bool sample_address
Definition: perf.h:46
bool sample_phys_addr
Definition: perf.h:47
bool use_clockid
Definition: perf.h:79
u64 branch_stack
Definition: perf.h:70
int record__parse_freq(const struct option *opt, const char *str, int unset)
Definition: record.c:306
bool inherit_stat
Definition: perf.h:40
unsigned int user_freq
Definition: perf.h:69
bool perf_guest
Definition: util.c:81
u64 default_interval
Definition: perf.h:73
u64 sample_user_regs
Definition: perf.h:72
bool no_inherit
Definition: perf.h:42
bool sample_transaction
Definition: perf.h:77
static int str(yyscan_t scanner, int token)
bool overwrite
Definition: perf.h:62
unsigned int mmap_pages
Definition: perf.h:67
bool sample_weight
Definition: perf.h:48
bool period_set
Definition: perf.h:53
bool all_kernel
Definition: perf.h:59
u64 sample_intr_regs
Definition: perf.h:71
bool running_time
Definition: perf.h:54
bool strict_freq
Definition: perf.h:64
void test_attr__init(void)
Definition: attr.c:42
bool auxtrace_snapshot_mode
Definition: perf.h:56
clockid_t clockid
Definition: perf.h:80
bool period
Definition: perf.h:52
bool all_user
Definition: perf.h:60
u32 pid
Definition: hists_common.c:15
bool sample_id
Definition: perf.h:65
bool ignore_missing_thread
Definition: perf.h:63
u32 flags
const char * input_name
Definition: perf.c:40
unsigned int freq
Definition: perf.h:66
Definition: attr.py:1
int version_verbose
unsigned initial_delay
Definition: perf.h:78
bool raw_samples
Definition: perf.h:45
bool sample_time_set
Definition: perf.h:50
unsigned int auxtrace_mmap_pages
Definition: perf.h:68
bool record_switch_events
Definition: perf.h:58
Definition: target.h:8