Loading...
1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H
3
4#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
15#include "perf-sys.h"
16
17#ifndef NSEC_PER_SEC
18# define NSEC_PER_SEC 1000000000ULL
19#endif
20#ifndef NSEC_PER_USEC
21# define NSEC_PER_USEC 1000ULL
22#endif
23
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}
31
32#define MAX_NR_CPUS 1024
33
34extern const char *input_name;
35extern bool perf_host, perf_guest;
36extern const char perf_version_string[];
37
38void pthread__unblock_sigwinch(void);
39
40#include "util/target.h"
41
42struct record_opts {
43 struct target target;
44 bool group;
45 bool inherit_stat;
46 bool no_buffering;
47 bool no_inherit;
48 bool no_inherit_set;
49 bool no_samples;
50 bool raw_samples;
51 bool sample_address;
52 bool sample_weight;
53 bool sample_time;
54 bool sample_time_set;
55 bool callgraph_set;
56 bool period;
57 bool running_time;
58 bool full_auxtrace;
59 bool auxtrace_snapshot_mode;
60 bool record_switch_events;
61 bool all_kernel;
62 bool all_user;
63 unsigned int freq;
64 unsigned int mmap_pages;
65 unsigned int auxtrace_mmap_pages;
66 unsigned int user_freq;
67 u64 branch_stack;
68 u64 sample_intr_regs;
69 u64 default_interval;
70 u64 user_interval;
71 size_t auxtrace_snapshot_size;
72 const char *auxtrace_snapshot_opts;
73 bool sample_transaction;
74 unsigned initial_delay;
75 bool use_clockid;
76 clockid_t clockid;
77 unsigned int proc_map_timeout;
78};
79
80struct option;
81extern const char * const *record_usage;
82extern struct option *record_options;
83#endif
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
10extern bool test_attr__enabled;
11void test_attr__ready(void);
12void test_attr__init(void);
13void 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
19static 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
29extern const char *input_name;
30extern bool perf_host, perf_guest;
31extern const char perf_version_string[];
32
33void pthread__unblock_sigwinch(void);
34
35#include "util/target.h"
36
37struct 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 bool no_samples;
45 bool raw_samples;
46 bool sample_address;
47 bool sample_phys_addr;
48 bool sample_weight;
49 bool sample_time;
50 bool sample_time_set;
51 bool sample_cpu;
52 bool period;
53 bool period_set;
54 bool running_time;
55 bool full_auxtrace;
56 bool auxtrace_snapshot_mode;
57 bool record_namespaces;
58 bool record_switch_events;
59 bool all_kernel;
60 bool all_user;
61 bool tail_synthesize;
62 bool overwrite;
63 bool ignore_missing_thread;
64 bool strict_freq;
65 bool sample_id;
66 unsigned int freq;
67 unsigned int mmap_pages;
68 unsigned int auxtrace_mmap_pages;
69 unsigned int user_freq;
70 u64 branch_stack;
71 u64 sample_intr_regs;
72 u64 sample_user_regs;
73 u64 default_interval;
74 u64 user_interval;
75 size_t auxtrace_snapshot_size;
76 const char *auxtrace_snapshot_opts;
77 bool sample_transaction;
78 unsigned initial_delay;
79 bool use_clockid;
80 clockid_t clockid;
81 unsigned int proc_map_timeout;
82};
83
84struct option;
85extern const char * const *record_usage;
86extern struct option *record_options;
87extern int version_verbose;
88
89int record__parse_freq(const struct option *opt, const char *str, int unset);
90#endif