diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-22 14:40:29 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-26 10:58:22 -0400 |
commit | aeb00b1aeab6dadd72c24f93bea51a46e109c2ba (patch) | |
tree | 892b5327ab415f62b61dcd39d6400eb66ef47e6d | |
parent | 38b7b678fe989f9c403c001d96887939aaa1b68a (diff) |
perf record: Move record_opts and other record decls out of perf.h
And into a separate util/record.h, to better isolate things and make
sure that those who use record_opts and the other moved declarations
are explicitly including the necessary header.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-31q8mei1qkh74qvkl9nwidfq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
30 files changed, 107 insertions, 73 deletions
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index c73da3245b67..a185dab2d903 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/zalloc.h> | 15 | #include <linux/zalloc.h> |
16 | 16 | ||
17 | #include "cs-etm.h" | 17 | #include "cs-etm.h" |
18 | #include "../../perf.h" | 18 | #include "../../util/record.h" |
19 | #include "../../util/auxtrace.h" | 19 | #include "../../util/auxtrace.h" |
20 | #include "../../util/cpumap.h" | 20 | #include "../../util/cpumap.h" |
21 | #include "../../util/evlist.h" | 21 | #include "../../util/evlist.h" |
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index 00915b8fd05b..cdd5c0c84183 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "../../util/pmu.h" | 19 | #include "../../util/pmu.h" |
20 | #include "../../util/debug.h" | 20 | #include "../../util/debug.h" |
21 | #include "../../util/auxtrace.h" | 21 | #include "../../util/auxtrace.h" |
22 | #include "../../util/record.h" | ||
22 | #include "../../util/arm-spe.h" | 23 | #include "../../util/arm-spe.h" |
23 | 24 | ||
24 | #define KiB(x) ((x) * 1024) | 25 | #define KiB(x) ((x) * 1024) |
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c index cab46f517b83..f32d7a72d039 100644 --- a/tools/perf/arch/s390/util/auxtrace.c +++ b/tools/perf/arch/s390/util/auxtrace.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "../../util/evlist.h" | 8 | #include "../../util/evlist.h" |
9 | #include "../../util/auxtrace.h" | 9 | #include "../../util/auxtrace.h" |
10 | #include "../../util/evsel.h" | 10 | #include "../../util/evsel.h" |
11 | #include "../../util/record.h" | ||
11 | 12 | ||
12 | #define PERF_EVENT_CPUM_SF 0xB0000 /* Event: Basic-sampling */ | 13 | #define PERF_EVENT_CPUM_SF 0xB0000 /* Event: Basic-sampling */ |
13 | #define PERF_EVENT_CPUM_SF_DIAG 0xBD000 /* Event: Combined-sampling */ | 14 | #define PERF_EVENT_CPUM_SF_DIAG 0xBD000 /* Event: Combined-sampling */ |
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c index 582182d98a7f..02776109ba46 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c | |||
@@ -1,6 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <errno.h> | 2 | #include <errno.h> |
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <stdbool.h> | ||
4 | #include <stdio.h> | 5 | #include <stdio.h> |
5 | #include <unistd.h> | 6 | #include <unistd.h> |
6 | #include <linux/types.h> | 7 | #include <linux/types.h> |
@@ -13,6 +14,7 @@ | |||
13 | #include "evsel.h" | 14 | #include "evsel.h" |
14 | #include "thread_map.h" | 15 | #include "thread_map.h" |
15 | #include "cpumap.h" | 16 | #include "cpumap.h" |
17 | #include "record.h" | ||
16 | #include "tsc.h" | 18 | #include "tsc.h" |
17 | #include "tests/tests.h" | 19 | #include "tests/tests.h" |
18 | 20 | ||
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 2d5d8a12dd1f..1f2cf612bc9c 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "../../util/session.h" | 17 | #include "../../util/session.h" |
18 | #include "../../util/pmu.h" | 18 | #include "../../util/pmu.h" |
19 | #include "../../util/debug.h" | 19 | #include "../../util/debug.h" |
20 | #include "../../util/record.h" | ||
20 | #include "../../util/tsc.h" | 21 | #include "../../util/tsc.h" |
21 | #include "../../util/auxtrace.h" | 22 | #include "../../util/auxtrace.h" |
22 | #include "../../util/intel-bts.h" | 23 | #include "../../util/intel-bts.h" |
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index c72a77a82b39..44cfe72c1a4c 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/zalloc.h> | 13 | #include <linux/zalloc.h> |
14 | #include <cpuid.h> | 14 | #include <cpuid.h> |
15 | 15 | ||
16 | #include "../../perf.h" | ||
17 | #include "../../util/session.h" | 16 | #include "../../util/session.h" |
18 | #include "../../util/event.h" | 17 | #include "../../util/event.h" |
19 | #include "../../util/evlist.h" | 18 | #include "../../util/evlist.h" |
@@ -24,6 +23,8 @@ | |||
24 | #include "../../util/pmu.h" | 23 | #include "../../util/pmu.h" |
25 | #include "../../util/debug.h" | 24 | #include "../../util/debug.h" |
26 | #include "../../util/auxtrace.h" | 25 | #include "../../util/auxtrace.h" |
26 | #include "../../util/record.h" | ||
27 | #include "../../util/target.h" | ||
27 | #include "../../util/tsc.h" | 28 | #include "../../util/tsc.h" |
28 | #include "../../util/intel-pt.h" | 29 | #include "../../util/intel-pt.h" |
29 | 30 | ||
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f71631f2bcb5..359bb8f33e57 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -8,8 +8,6 @@ | |||
8 | */ | 8 | */ |
9 | #include "builtin.h" | 9 | #include "builtin.h" |
10 | 10 | ||
11 | #include "perf.h" | ||
12 | |||
13 | #include "util/build-id.h" | 11 | #include "util/build-id.h" |
14 | #include <subcmd/parse-options.h> | 12 | #include <subcmd/parse-options.h> |
15 | #include "util/parse-events.h" | 13 | #include "util/parse-events.h" |
@@ -22,9 +20,11 @@ | |||
22 | #include "util/evlist.h" | 20 | #include "util/evlist.h" |
23 | #include "util/evsel.h" | 21 | #include "util/evsel.h" |
24 | #include "util/debug.h" | 22 | #include "util/debug.h" |
23 | #include "util/target.h" | ||
25 | #include "util/session.h" | 24 | #include "util/session.h" |
26 | #include "util/tool.h" | 25 | #include "util/tool.h" |
27 | #include "util/symbol.h" | 26 | #include "util/symbol.h" |
27 | #include "util/record.h" | ||
28 | #include "util/cpumap.h" | 28 | #include "util/cpumap.h" |
29 | #include "util/thread_map.h" | 29 | #include "util/thread_map.h" |
30 | #include "util/data.h" | 30 | #include "util/data.h" |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 9b93ddeaeafa..ee05621d3bd6 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -1,7 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "builtin.h" | 2 | #include "builtin.h" |
3 | 3 | ||
4 | #include "perf.h" | ||
5 | #include "util/cache.h" | 4 | #include "util/cache.h" |
6 | #include "util/counts.h" | 5 | #include "util/counts.h" |
7 | #include "util/debug.h" | 6 | #include "util/debug.h" |
@@ -51,6 +50,7 @@ | |||
51 | #include <unistd.h> | 50 | #include <unistd.h> |
52 | #include <subcmd/pager.h> | 51 | #include <subcmd/pager.h> |
53 | #include <perf/evlist.h> | 52 | #include <perf/evlist.h> |
53 | #include "util/record.h" | ||
54 | 54 | ||
55 | #include <linux/ctype.h> | 55 | #include <linux/ctype.h> |
56 | 56 | ||
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 8a4f1a7d0cba..6ab13f466827 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -40,7 +40,6 @@ | |||
40 | * Jaswinder Singh Rajput <jaswinder@kernel.org> | 40 | * Jaswinder Singh Rajput <jaswinder@kernel.org> |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #include "perf.h" | ||
44 | #include "builtin.h" | 43 | #include "builtin.h" |
45 | #include "util/cgroup.h" | 44 | #include "util/cgroup.h" |
46 | #include <subcmd/parse-options.h> | 45 | #include <subcmd/parse-options.h> |
@@ -62,6 +61,7 @@ | |||
62 | #include "util/tool.h" | 61 | #include "util/tool.h" |
63 | #include "util/string2.h" | 62 | #include "util/string2.h" |
64 | #include "util/metricgroup.h" | 63 | #include "util/metricgroup.h" |
64 | #include "util/target.h" | ||
65 | #include "util/top.h" | 65 | #include "util/top.h" |
66 | #include "asm/bug.h" | 66 | #include "asm/bug.h" |
67 | 67 | ||
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index de126258ca10..8ea62fd2591d 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -14,6 +14,7 @@ | |||
14 | * http://lwn.net/Articles/415728/ ("Announcing a new utility: 'trace'") | 14 | * http://lwn.net/Articles/415728/ ("Announcing a new utility: 'trace'") |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "util/record.h" | ||
17 | #include <traceevent/event-parse.h> | 18 | #include <traceevent/event-parse.h> |
18 | #include <api/fs/tracing_path.h> | 19 | #include <api/fs/tracing_path.h> |
19 | #include <bpf/bpf.h> | 20 | #include <bpf/bpf.h> |
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index dc0a7a237887..d9e6b8b957b6 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -35,63 +35,6 @@ extern const char perf_version_string[]; | |||
35 | 35 | ||
36 | void pthread__unblock_sigwinch(void); | 36 | void pthread__unblock_sigwinch(void); |
37 | 37 | ||
38 | #include "util/target.h" | ||
39 | |||
40 | struct record_opts { | ||
41 | struct target target; | ||
42 | bool group; | ||
43 | bool inherit_stat; | ||
44 | bool no_buffering; | ||
45 | bool no_inherit; | ||
46 | bool no_inherit_set; | ||
47 | bool no_samples; | ||
48 | bool raw_samples; | ||
49 | bool sample_address; | ||
50 | bool sample_phys_addr; | ||
51 | bool sample_weight; | ||
52 | bool sample_time; | ||
53 | bool sample_time_set; | ||
54 | bool sample_cpu; | ||
55 | bool period; | ||
56 | bool period_set; | ||
57 | bool running_time; | ||
58 | bool full_auxtrace; | ||
59 | bool auxtrace_snapshot_mode; | ||
60 | bool auxtrace_snapshot_on_exit; | ||
61 | bool record_namespaces; | ||
62 | bool record_switch_events; | ||
63 | bool all_kernel; | ||
64 | bool all_user; | ||
65 | bool kernel_callchains; | ||
66 | bool user_callchains; | ||
67 | bool tail_synthesize; | ||
68 | bool overwrite; | ||
69 | bool ignore_missing_thread; | ||
70 | bool strict_freq; | ||
71 | bool sample_id; | ||
72 | bool no_bpf_event; | ||
73 | unsigned int freq; | ||
74 | unsigned int mmap_pages; | ||
75 | unsigned int auxtrace_mmap_pages; | ||
76 | unsigned int user_freq; | ||
77 | u64 branch_stack; | ||
78 | u64 sample_intr_regs; | ||
79 | u64 sample_user_regs; | ||
80 | u64 default_interval; | ||
81 | u64 user_interval; | ||
82 | size_t auxtrace_snapshot_size; | ||
83 | const char *auxtrace_snapshot_opts; | ||
84 | bool sample_transaction; | ||
85 | unsigned initial_delay; | ||
86 | bool use_clockid; | ||
87 | clockid_t clockid; | ||
88 | u64 clockid_res_ns; | ||
89 | int nr_cblocks; | ||
90 | int affinity; | ||
91 | int mmap_flush; | ||
92 | unsigned int comp_level; | ||
93 | }; | ||
94 | |||
95 | enum perf_affinity { | 38 | enum perf_affinity { |
96 | PERF_AFFINITY_SYS = 0, | 39 | PERF_AFFINITY_SYS = 0, |
97 | PERF_AFFINITY_NODE, | 40 | PERF_AFFINITY_NODE, |
@@ -99,10 +42,5 @@ enum perf_affinity { | |||
99 | PERF_AFFINITY_MAX | 42 | PERF_AFFINITY_MAX |
100 | }; | 43 | }; |
101 | 44 | ||
102 | struct option; | ||
103 | extern const char * const *record_usage; | ||
104 | extern struct option *record_options; | ||
105 | extern int version_verbose; | 45 | extern int version_verbose; |
106 | |||
107 | int record__parse_freq(const struct option *opt, const char *str, int unset); | ||
108 | #endif | 46 | #endif |
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index 9bdf66139099..b6f27ef9fb02 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c | |||
@@ -4,9 +4,9 @@ | |||
4 | * beginning | 4 | * beginning |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <perf.h> | ||
8 | #include <evlist.h> | 7 | #include <evlist.h> |
9 | #include <sys/prctl.h> | 8 | #include <sys/prctl.h> |
9 | #include "record.h" | ||
10 | #include "tests.h" | 10 | #include "tests.h" |
11 | #include "debug.h" | 11 | #include "debug.h" |
12 | #include <errno.h> | 12 | #include <errno.h> |
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index e16f927f38b6..98642961fc63 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <sys/types.h> | 5 | #include <sys/types.h> |
6 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
7 | #include <fcntl.h> | 7 | #include <fcntl.h> |
8 | #include <util/record.h> | ||
8 | #include <util/util.h> | 9 | #include <util/util.h> |
9 | #include <util/bpf-loader.h> | 10 | #include <util/bpf-loader.h> |
10 | #include <util/evlist.h> | 11 | #include <util/evlist.h> |
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index e45df0736261..fe671b860086 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "map.h" | 20 | #include "map.h" |
21 | #include "symbol.h" | 21 | #include "symbol.h" |
22 | #include "event.h" | 22 | #include "event.h" |
23 | #include "record.h" | ||
23 | #include "thread.h" | 24 | #include "thread.h" |
24 | 25 | ||
25 | #include "tests.h" | 26 | #include "tests.h" |
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index 0ce5ce33bac4..2af6faf1bbd6 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "parse-events.h" | 8 | #include "parse-events.h" |
9 | #include "evlist.h" | 9 | #include "evlist.h" |
10 | #include "evsel.h" | 10 | #include "evsel.h" |
11 | #include "record.h" | ||
11 | #include "thread_map.h" | 12 | #include "thread_map.h" |
12 | #include "cpumap.h" | 13 | #include "cpumap.h" |
13 | #include "tests.h" | 14 | #include "tests.h" |
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index 9c06130d37be..62492106fb5e 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c | |||
@@ -1,12 +1,13 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <stdbool.h> | ||
2 | #include <linux/err.h> | 3 | #include <linux/err.h> |
3 | #include <sys/types.h> | 4 | #include <sys/types.h> |
4 | #include <sys/stat.h> | 5 | #include <sys/stat.h> |
5 | #include <fcntl.h> | 6 | #include <fcntl.h> |
6 | #include "perf.h" | ||
7 | #include "evlist.h" | 7 | #include "evlist.h" |
8 | #include "evsel.h" | 8 | #include "evsel.h" |
9 | #include "thread_map.h" | 9 | #include "thread_map.h" |
10 | #include "record.h" | ||
10 | #include "tests.h" | 11 | #include "tests.h" |
11 | #include "debug.h" | 12 | #include "debug.h" |
12 | #include <errno.h> | 13 | #include <errno.h> |
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 67b388e92cba..3a205f6f9363 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c | |||
@@ -7,8 +7,8 @@ | |||
7 | #include <sched.h> | 7 | #include <sched.h> |
8 | #include "evlist.h" | 8 | #include "evlist.h" |
9 | #include "evsel.h" | 9 | #include "evsel.h" |
10 | #include "perf.h" | ||
11 | #include "debug.h" | 10 | #include "debug.h" |
11 | #include "record.h" | ||
12 | #include "tests.h" | 12 | #include "tests.h" |
13 | 13 | ||
14 | static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp) | 14 | static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp) |
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index e3cee69f6ea2..b63f02768724 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "evsel.h" | 13 | #include "evsel.h" |
14 | #include "thread_map.h" | 14 | #include "thread_map.h" |
15 | #include "cpumap.h" | 15 | #include "cpumap.h" |
16 | #include "record.h" | ||
16 | #include "tests.h" | 17 | #include "tests.h" |
17 | 18 | ||
18 | static int spin_sleep(void) | 19 | static int spin_sleep(void) |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 4ca38fd0379a..d79a22e2d8be 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -1,6 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "evlist.h" | 2 | #include "evlist.h" |
3 | #include "evsel.h" | 3 | #include "evsel.h" |
4 | #include "target.h" | ||
4 | #include "thread_map.h" | 5 | #include "thread_map.h" |
5 | #include "cpumap.h" | 6 | #include "cpumap.h" |
6 | #include "tests.h" | 7 | #include "tests.h" |
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 094e6ceb3cf2..12e9b7acbb2c 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/zalloc.h> | 27 | #include <linux/zalloc.h> |
28 | 28 | ||
29 | #include "../perf.h" | ||
30 | #include "evlist.h" | 29 | #include "evlist.h" |
31 | #include "dso.h" | 30 | #include "dso.h" |
32 | #include "map.h" | 31 | #include "map.h" |
@@ -41,6 +40,7 @@ | |||
41 | #include <linux/hash.h> | 40 | #include <linux/hash.h> |
42 | 41 | ||
43 | #include "event.h" | 42 | #include "event.h" |
43 | #include "record.h" | ||
44 | #include "session.h" | 44 | #include "session.h" |
45 | #include "debug.h" | 45 | #include "debug.h" |
46 | #include <subcmd/parse-options.h> | 46 | #include <subcmd/parse-options.h> |
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 5a5dcc6d8f85..5c634bcfea7e 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include "session.h" | 14 | #include "session.h" |
15 | #include "map.h" | 15 | #include "map.h" |
16 | #include "evlist.h" | 16 | #include "evlist.h" |
17 | #include "record.h" | ||
17 | 18 | ||
18 | #define ptr_to_u64(ptr) ((__u64)(unsigned long)(ptr)) | 19 | #define ptr_to_u64(ptr) ((__u64)(unsigned long)(ptr)) |
19 | 20 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e983e721beca..9fadd5857ccc 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "thread_map.h" | 34 | #include "thread_map.h" |
35 | #include "target.h" | 35 | #include "target.h" |
36 | #include "perf_regs.h" | 36 | #include "perf_regs.h" |
37 | #include "record.h" | ||
37 | #include "debug.h" | 38 | #include "debug.h" |
38 | #include "trace-event.h" | 39 | #include "trace-event.h" |
39 | #include "stat.h" | 40 | #include "stat.h" |
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h index a09c495f866b..46913637085b 100644 --- a/tools/perf/util/kvm-stat.h +++ b/tools/perf/util/kvm-stat.h | |||
@@ -2,9 +2,9 @@ | |||
2 | #ifndef __PERF_KVM_STAT_H | 2 | #ifndef __PERF_KVM_STAT_H |
3 | #define __PERF_KVM_STAT_H | 3 | #define __PERF_KVM_STAT_H |
4 | 4 | ||
5 | #include "../perf.h" | ||
6 | #include "tool.h" | 5 | #include "tool.h" |
7 | #include "stat.h" | 6 | #include "stat.h" |
7 | #include "record.h" | ||
8 | 8 | ||
9 | struct evsel; | 9 | struct evsel; |
10 | struct evlist; | 10 | struct evlist; |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5734460fc89e..f7c1a7e6c4ba 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "symbol.h" | 13 | #include "symbol.h" |
14 | #include "sort.h" | 14 | #include "sort.h" |
15 | #include "strlist.h" | 15 | #include "strlist.h" |
16 | #include "target.h" | ||
16 | #include "thread.h" | 17 | #include "thread.h" |
17 | #include "vdso.h" | 18 | #include "vdso.h" |
18 | #include <stdbool.h> | 19 | #include <stdbool.h> |
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 8b9d7157276d..7d69119d0b5d 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h | |||
@@ -14,6 +14,7 @@ struct branch_stack; | |||
14 | struct evsel; | 14 | struct evsel; |
15 | struct perf_sample; | 15 | struct perf_sample; |
16 | struct symbol; | 16 | struct symbol; |
17 | struct target; | ||
17 | struct thread; | 18 | struct thread; |
18 | union perf_event; | 19 | union perf_event; |
19 | 20 | ||
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 51bbd0714e6d..574507d46c98 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <perf/cpumap.h> | 9 | #include <perf/cpumap.h> |
10 | #include "util.h" | 10 | #include "util.h" |
11 | #include "cloexec.h" | 11 | #include "cloexec.h" |
12 | #include "record.h" | ||
12 | 13 | ||
13 | typedef void (*setup_probe_fn_t)(struct evsel *evsel); | 14 | typedef void (*setup_probe_fn_t)(struct evsel *evsel); |
14 | 15 | ||
diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h new file mode 100644 index 000000000000..00275afc524d --- /dev/null +++ b/tools/perf/util/record.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef _PERF_RECORD_H | ||
3 | #define _PERF_RECORD_H | ||
4 | |||
5 | #include <time.h> | ||
6 | #include <stdbool.h> | ||
7 | #include <linux/types.h> | ||
8 | #include <linux/stddef.h> | ||
9 | #include <linux/perf_event.h> | ||
10 | #include "util/target.h" | ||
11 | |||
12 | struct option; | ||
13 | |||
14 | struct record_opts { | ||
15 | struct target target; | ||
16 | bool group; | ||
17 | bool inherit_stat; | ||
18 | bool no_buffering; | ||
19 | bool no_inherit; | ||
20 | bool no_inherit_set; | ||
21 | bool no_samples; | ||
22 | bool raw_samples; | ||
23 | bool sample_address; | ||
24 | bool sample_phys_addr; | ||
25 | bool sample_weight; | ||
26 | bool sample_time; | ||
27 | bool sample_time_set; | ||
28 | bool sample_cpu; | ||
29 | bool period; | ||
30 | bool period_set; | ||
31 | bool running_time; | ||
32 | bool full_auxtrace; | ||
33 | bool auxtrace_snapshot_mode; | ||
34 | bool auxtrace_snapshot_on_exit; | ||
35 | bool record_namespaces; | ||
36 | bool record_switch_events; | ||
37 | bool all_kernel; | ||
38 | bool all_user; | ||
39 | bool kernel_callchains; | ||
40 | bool user_callchains; | ||
41 | bool tail_synthesize; | ||
42 | bool overwrite; | ||
43 | bool ignore_missing_thread; | ||
44 | bool strict_freq; | ||
45 | bool sample_id; | ||
46 | bool no_bpf_event; | ||
47 | unsigned int freq; | ||
48 | unsigned int mmap_pages; | ||
49 | unsigned int auxtrace_mmap_pages; | ||
50 | unsigned int user_freq; | ||
51 | u64 branch_stack; | ||
52 | u64 sample_intr_regs; | ||
53 | u64 sample_user_regs; | ||
54 | u64 default_interval; | ||
55 | u64 user_interval; | ||
56 | size_t auxtrace_snapshot_size; | ||
57 | const char *auxtrace_snapshot_opts; | ||
58 | bool sample_transaction; | ||
59 | unsigned initial_delay; | ||
60 | bool use_clockid; | ||
61 | clockid_t clockid; | ||
62 | u64 clockid_res_ns; | ||
63 | int nr_cblocks; | ||
64 | int affinity; | ||
65 | int mmap_flush; | ||
66 | unsigned int comp_level; | ||
67 | }; | ||
68 | |||
69 | extern const char * const *record_usage; | ||
70 | extern struct option *record_options; | ||
71 | |||
72 | int record__parse_freq(const struct option *opt, const char *str, int unset); | ||
73 | |||
74 | #endif // _PERF_RECORD_H | ||
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 0cbfd1eca1dd..f985336b3a22 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <math.h> | 4 | #include <math.h> |
5 | #include "counts.h" | 5 | #include "counts.h" |
6 | #include "stat.h" | 6 | #include "stat.h" |
7 | #include "target.h" | ||
7 | #include "evlist.h" | 8 | #include "evlist.h" |
8 | #include "evsel.h" | 9 | #include "evsel.h" |
9 | #include "thread_map.h" | 10 | #include "thread_map.h" |
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 9e425ecd82d9..14fe3e548229 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h | |||
@@ -198,6 +198,8 @@ int perf_stat_process_counter(struct perf_stat_config *config, | |||
198 | struct perf_tool; | 198 | struct perf_tool; |
199 | union perf_event; | 199 | union perf_event; |
200 | struct perf_session; | 200 | struct perf_session; |
201 | struct target; | ||
202 | |||
201 | int perf_event__process_stat_event(struct perf_session *session, | 203 | int perf_event__process_stat_event(struct perf_session *session, |
202 | union perf_event *event); | 204 | union perf_event *event); |
203 | 205 | ||
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index dc4bb6e52a83..7367433e767a 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "tool.h" | 5 | #include "tool.h" |
6 | #include "evswitch.h" | 6 | #include "evswitch.h" |
7 | #include "annotate.h" | 7 | #include "annotate.h" |
8 | #include "record.h" | ||
8 | #include <linux/types.h> | 9 | #include <linux/types.h> |
9 | #include <stddef.h> | 10 | #include <stddef.h> |
10 | #include <stdbool.h> | 11 | #include <stdbool.h> |