]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - tools/perf/perf.h
Merge tag 'xfs-5.1-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[mirror_ubuntu-jammy-kernel.git] / tools / perf / perf.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
6eda5838
TG
2#ifndef _PERF_PERF_H
3#define _PERF_PERF_H
4
1a482f38 5#include <time.h>
82baa0eb 6#include <stdbool.h>
d944c4ee 7#include <linux/types.h>
44fe619b 8#include <linux/stddef.h>
d2709c7c 9#include <linux/perf_event.h>
1a482f38 10
82baa0eb 11extern bool test_attr__enabled;
10213e2f 12void test_attr__ready(void);
82baa0eb
JO
13void test_attr__init(void);
14void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
15 int fd, int group_fd, unsigned long flags);
16
17#define HAVE_ATTR_TEST
18#include "perf-sys.h"
19
a92e7023
TG
20static inline unsigned long long rdclock(void)
21{
22 struct timespec ts;
23
24 clock_gettime(CLOCK_MONOTONIC, &ts);
25 return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
26}
6eda5838 27
21b8732e 28#ifndef MAX_NR_CPUS
4d255766 29#define MAX_NR_CPUS 1024
21b8732e 30#endif
6eda5838 31
70cb4e96 32extern const char *input_name;
8035458f 33extern bool perf_host, perf_guest;
fbe96f29 34extern const char perf_version_string[];
a1645ce1 35
3af6e338
ACM
36void pthread__unblock_sigwinch(void);
37
12864b31 38#include "util/target.h"
bea03405 39
b4006796 40struct record_opts {
602ad878 41 struct target target;
ed80f581 42 bool group;
0f82ebc4 43 bool inherit_stat;
509051ea 44 bool no_buffering;
0f82ebc4 45 bool no_inherit;
69e7e5b0 46 bool no_inherit_set;
0f82ebc4
ACM
47 bool no_samples;
48 bool raw_samples;
49 bool sample_address;
3b0a5daa 50 bool sample_phys_addr;
05484298 51 bool sample_weight;
0f82ebc4 52 bool sample_time;
3abebc55 53 bool sample_time_set;
b6f35ed7 54 bool sample_cpu;
3e76ac78 55 bool period;
f290aa1f 56 bool period_set;
85c273d2 57 bool running_time;
9e0cc4fe 58 bool full_auxtrace;
d20031bb 59 bool auxtrace_snapshot_mode;
f3b3614a 60 bool record_namespaces;
b757bb09 61 bool record_switch_events;
85723885
JO
62 bool all_kernel;
63 bool all_user;
4ea648ae 64 bool tail_synthesize;
626a6b78 65 bool overwrite;
a359c17a 66 bool ignore_missing_thread;
b09c2364 67 bool strict_freq;
ad46e48c 68 bool sample_id;
45178a92 69 bool bpf_event;
0f82ebc4 70 unsigned int freq;
01c2d99b 71 unsigned int mmap_pages;
9e0cc4fe 72 unsigned int auxtrace_mmap_pages;
0f82ebc4 73 unsigned int user_freq;
a00dc319 74 u64 branch_stack;
bcc84ec6 75 u64 sample_intr_regs;
84c41742 76 u64 sample_user_regs;
0f82ebc4
ACM
77 u64 default_interval;
78 u64 user_interval;
d20031bb
AH
79 size_t auxtrace_snapshot_size;
80 const char *auxtrace_snapshot_opts;
475eeab9 81 bool sample_transaction;
6619a53e 82 unsigned initial_delay;
814c8c38
PZ
83 bool use_clockid;
84 clockid_t clockid;
cf790516 85 u64 clockid_res_ns;
d3d1af6f 86 int nr_cblocks;
9d2ed645
AB
87 int affinity;
88};
89
90enum perf_affinity {
91 PERF_AFFINITY_SYS = 0,
92 PERF_AFFINITY_NODE,
93 PERF_AFFINITY_CPU,
94 PERF_AFFINITY_MAX
0f82ebc4
ACM
95};
96
e5b2c207
NK
97struct option;
98extern const char * const *record_usage;
99extern struct option *record_options;
3aa94b10 100extern int version_verbose;
67230479
ACM
101
102int record__parse_freq(const struct option *opt, const char *str, int unset);
6eda5838 103#endif