diff options
41 files changed, 98 insertions, 38 deletions
diff --git a/tools/perf/arch/arm/annotate/instructions.c b/tools/perf/arch/arm/annotate/instructions.c index c7d1a69b894f..e1d4b484cc4b 100644 --- a/tools/perf/arch/arm/annotate/instructions.c +++ b/tools/perf/arch/arm/annotate/instructions.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/zalloc.h> | 3 | #include <linux/zalloc.h> |
4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
5 | #include <regex.h> | 5 | #include <regex.h> |
6 | #include <stdlib.h> | ||
6 | 7 | ||
7 | struct arm_annotate { | 8 | struct arm_annotate { |
8 | regex_t call_insn, | 9 | regex_t call_insn, |
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 59e44f90dc46..c32db09baf0d 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "../../util/pmu.h" | 26 | #include "../../util/pmu.h" |
27 | #include "../../util/cs-etm.h" | 27 | #include "../../util/cs-etm.h" |
28 | #include "../../util/util.h" | 28 | #include "../../util/util.h" |
29 | #include "../../util/session.h" | ||
29 | 30 | ||
30 | #include <errno.h> | 31 | #include <errno.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
diff --git a/tools/perf/arch/arm64/annotate/instructions.c b/tools/perf/arch/arm64/annotate/instructions.c index 8f70a1b282df..43aa93ed8414 100644 --- a/tools/perf/arch/arm64/annotate/instructions.c +++ b/tools/perf/arch/arm64/annotate/instructions.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <regex.h> | 4 | #include <regex.h> |
5 | #include <stdlib.h> | ||
5 | 6 | ||
6 | struct arm64_annotate { | 7 | struct arm64_annotate { |
7 | regex_t call_insn, | 8 | regex_t call_insn, |
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 2d1f4713b728..eb3635941c2b 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 <limits.h> | ||
4 | #include <stdbool.h> | 5 | #include <stdbool.h> |
5 | #include <stdio.h> | 6 | #include <stdio.h> |
6 | #include <unistd.h> | 7 | #include <unistd.h> |
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 2f8ea44c00c4..d5adc417a4ca 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <errno.h> | 10 | #include <errno.h> |
11 | #include <unistd.h> | 11 | #include <unistd.h> |
12 | #include <signal.h> | 12 | #include <signal.h> |
13 | #include <stdlib.h> | ||
13 | #include <fcntl.h> | 14 | #include <fcntl.h> |
14 | #include <poll.h> | 15 | #include <poll.h> |
15 | #include <linux/capability.h> | 16 | #include <linux/capability.h> |
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index 512288e9f547..a637a4a90760 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include "record.h" | 9 | #include "record.h" |
10 | #include "tests.h" | 10 | #include "tests.h" |
11 | #include "debug.h" | 11 | #include "debug.h" |
12 | #include "parse-events.h" | ||
12 | #include <errno.h> | 13 | #include <errno.h> |
13 | #include <linux/string.h> | 14 | #include <linux/string.h> |
14 | 15 | ||
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index 9fc163b2acbb..fc102e4f403e 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "tests.h" | 18 | #include "tests.h" |
19 | #include "llvm.h" | 19 | #include "llvm.h" |
20 | #include "debug.h" | 20 | #include "debug.h" |
21 | #include "parse-events.h" | ||
21 | #define NR_ITERS 111 | 22 | #define NR_ITERS 111 |
22 | #define PERF_TEST_BPF_PATH "/sys/fs/bpf/perf_test" | 23 | #define PERF_TEST_BPF_PATH "/sys/fs/bpf/perf_test" |
23 | 24 | ||
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index c3bec9d2c201..55774baffc2a 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <errno.h> | 8 | #include <errno.h> |
9 | #include <unistd.h> | 9 | #include <unistd.h> |
10 | #include <string.h> | 10 | #include <string.h> |
11 | #include <stdlib.h> | ||
11 | #include <sys/types.h> | 12 | #include <sys/types.h> |
12 | #include <dirent.h> | 13 | #include <dirent.h> |
13 | #include <sys/wait.h> | 14 | #include <sys/wait.h> |
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index 7b2b89f4b716..c1c29e08e7fb 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -13,7 +13,9 @@ | |||
13 | 13 | ||
14 | #include "debug.h" | 14 | #include "debug.h" |
15 | #include "dso.h" | 15 | #include "dso.h" |
16 | #include "env.h" | ||
16 | #include "parse-events.h" | 17 | #include "parse-events.h" |
18 | #include "trace-event.h" | ||
17 | #include "evlist.h" | 19 | #include "evlist.h" |
18 | #include "evsel.h" | 20 | #include "evsel.h" |
19 | #include "thread_map.h" | 21 | #include "thread_map.h" |
@@ -496,6 +498,10 @@ static void fs_something(void) | |||
496 | } | 498 | } |
497 | } | 499 | } |
498 | 500 | ||
501 | #ifdef __s390x__ | ||
502 | #include "header.h" // for get_cpuid() | ||
503 | #endif | ||
504 | |||
499 | static const char *do_determine_event(bool excl_kernel) | 505 | static const char *do_determine_event(bool excl_kernel) |
500 | { | 506 | { |
501 | const char *event = excl_kernel ? "cycles:u" : "cycles"; | 507 | const char *event = excl_kernel ? "cycles:u" : "cycles"; |
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c index 228d1618cf7d..d824a726906c 100644 --- a/tools/perf/tests/event-times.c +++ b/tools/perf/tests/event-times.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "evsel.h" | 11 | #include "evsel.h" |
12 | #include "util.h" | 12 | #include "util.h" |
13 | #include "debug.h" | 13 | #include "debug.h" |
14 | #include "parse-events.h" | ||
14 | #include "thread_map.h" | 15 | #include "thread_map.h" |
15 | #include "target.h" | 16 | #include "target.h" |
16 | 17 | ||
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index 4b68ec3a13fc..cac4290e233a 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c | |||
@@ -1,8 +1,10 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <perf/cpumap.h> | 3 | #include <perf/cpumap.h> |
4 | #include <string.h> | ||
4 | #include "evlist.h" | 5 | #include "evlist.h" |
5 | #include "evsel.h" | 6 | #include "evsel.h" |
7 | #include "header.h" | ||
6 | #include "machine.h" | 8 | #include "machine.h" |
7 | #include "tool.h" | 9 | #include "tool.h" |
8 | #include "tests.h" | 10 | #include "tests.h" |
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index c758798d3774..9f0762d987fa 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c | |||
@@ -1,5 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <linux/types.h> | 2 | #include <linux/types.h> |
3 | #include <limits.h> | ||
3 | #include <unistd.h> | 4 | #include <unistd.h> |
4 | #include <sys/prctl.h> | 5 | #include <sys/prctl.h> |
5 | #include <perf/cpumap.h> | 6 | #include <perf/cpumap.h> |
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index bdf77bfe1b80..85e1d7337dc0 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | /* For the CLR_() macros */ | 4 | /* For the CLR_() macros */ |
5 | #include <pthread.h> | 5 | #include <pthread.h> |
6 | #include <stdlib.h> | ||
6 | #include <perf/cpumap.h> | 7 | #include <perf/cpumap.h> |
7 | 8 | ||
8 | #include "debug.h" | 9 | #include "debug.h" |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 49f52e4de41b..02ba696fb87f 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <api/fs/fs.h> | 5 | #include <api/fs/fs.h> |
6 | #include "tests.h" | 6 | #include "tests.h" |
7 | #include "debug.h" | 7 | #include "debug.h" |
8 | #include "pmu.h" | ||
8 | #include "util.h" | 9 | #include "util.h" |
9 | #include <dirent.h> | 10 | #include <dirent.h> |
10 | #include <errno.h> | 11 | #include <errno.h> |
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 4bed15aee1a8..1a60fa1219f5 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <sys/time.h> | 2 | #include <sys/time.h> |
3 | #include <sys/prctl.h> | 3 | #include <sys/prctl.h> |
4 | #include <errno.h> | 4 | #include <errno.h> |
5 | #include <limits.h> | ||
5 | #include <time.h> | 6 | #include <time.h> |
6 | #include <stdlib.h> | 7 | #include <stdlib.h> |
7 | #include <linux/zalloc.h> | 8 | #include <linux/zalloc.h> |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index cf8857456056..f7e54c16e594 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "../../util/callchain.h" | 16 | #include "../../util/callchain.h" |
17 | #include "../../util/evsel.h" | 17 | #include "../../util/evsel.h" |
18 | #include "../../util/evlist.h" | 18 | #include "../../util/evlist.h" |
19 | #include "../../util/header.h" | ||
19 | #include "../../util/hist.h" | 20 | #include "../../util/hist.h" |
20 | #include "../../util/map.h" | 21 | #include "../../util/map.h" |
21 | #include "../../util/symbol.h" | 22 | #include "../../util/symbol.h" |
diff --git a/tools/perf/ui/browsers/res_sample.c b/tools/perf/ui/browsers/res_sample.c index db3954fea74c..f16a38fea45e 100644 --- a/tools/perf/ui/browsers/res_sample.c +++ b/tools/perf/ui/browsers/res_sample.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include "../util.h" | 9 | #include "../util.h" |
10 | #include "../../util/util.h" | 10 | #include "../../util/util.h" |
11 | #include "../../perf.h" | 11 | #include "../../perf.h" |
12 | #include <stdlib.h> | ||
13 | #include <string.h> | ||
12 | #include <linux/time64.h> | 14 | #include <linux/time64.h> |
13 | #include <linux/zalloc.h> | 15 | #include <linux/zalloc.h> |
14 | 16 | ||
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c index bf1d9f9ec035..586a21acc13d 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include "config.h" | 10 | #include "config.h" |
11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
12 | #include <linux/zalloc.h> | 12 | #include <linux/zalloc.h> |
13 | #include <stdlib.h> | ||
13 | 14 | ||
14 | #define SCRIPT_NAMELEN 128 | 15 | #define SCRIPT_NAMELEN 128 |
15 | #define SCRIPT_MAX_NO 64 | 16 | #define SCRIPT_MAX_NO 64 |
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index bf90ce5b2cdf..3e533de7d852 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -1,6 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <inttypes.h> | 2 | #include <inttypes.h> |
3 | #include <math.h> | 3 | #include <math.h> |
4 | #include <stdlib.h> | ||
5 | #include <string.h> | ||
4 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
5 | 7 | ||
6 | #include "../util/callchain.h" | 8 | #include "../util/callchain.h" |
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 51ed67548b83..832ca6cfbe30 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -1,5 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | ||
3 | #include <linux/string.h> | 4 | #include <linux/string.h> |
4 | 5 | ||
5 | #include "../../util/callchain.h" | 6 | #include "../../util/callchain.h" |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index eb3c50de831d..1748f528b6e9 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | #include <inttypes.h> | 10 | #include <inttypes.h> |
11 | #include <libgen.h> | 11 | #include <libgen.h> |
12 | #include <stdlib.h> | ||
12 | #include <bpf/bpf.h> | 13 | #include <bpf/bpf.h> |
13 | #include <bpf/btf.h> | 14 | #include <bpf/btf.h> |
14 | #include <bpf/libbpf.h> | 15 | #include <bpf/libbpf.h> |
@@ -20,7 +21,9 @@ | |||
20 | #include "color.h" | 21 | #include "color.h" |
21 | #include "config.h" | 22 | #include "config.h" |
22 | #include "dso.h" | 23 | #include "dso.h" |
24 | #include "env.h" | ||
23 | #include "map.h" | 25 | #include "map.h" |
26 | #include "map_groups.h" | ||
24 | #include "symbol.h" | 27 | #include "symbol.h" |
25 | #include "srcline.h" | 28 | #include "srcline.h" |
26 | #include "units.h" | 29 | #include "units.h" |
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 10c707724035..6f25224a3def 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c | |||
@@ -2196,3 +2196,36 @@ int auxtrace_parse_filters(struct evlist *evlist) | |||
2196 | 2196 | ||
2197 | return 0; | 2197 | return 0; |
2198 | } | 2198 | } |
2199 | |||
2200 | int auxtrace__process_event(struct perf_session *session, union perf_event *event, | ||
2201 | struct perf_sample *sample, struct perf_tool *tool) | ||
2202 | { | ||
2203 | if (!session->auxtrace) | ||
2204 | return 0; | ||
2205 | |||
2206 | return session->auxtrace->process_event(session, event, sample, tool); | ||
2207 | } | ||
2208 | |||
2209 | int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool) | ||
2210 | { | ||
2211 | if (!session->auxtrace) | ||
2212 | return 0; | ||
2213 | |||
2214 | return session->auxtrace->flush_events(session, tool); | ||
2215 | } | ||
2216 | |||
2217 | void auxtrace__free_events(struct perf_session *session) | ||
2218 | { | ||
2219 | if (!session->auxtrace) | ||
2220 | return; | ||
2221 | |||
2222 | return session->auxtrace->free_events(session); | ||
2223 | } | ||
2224 | |||
2225 | void auxtrace__free(struct perf_session *session) | ||
2226 | { | ||
2227 | if (!session->auxtrace) | ||
2228 | return; | ||
2229 | |||
2230 | return session->auxtrace->free(session); | ||
2231 | } | ||
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index c539e7b6ed56..37e70dc01436 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <asm/barrier.h> | 18 | #include <asm/barrier.h> |
19 | 19 | ||
20 | #include "event.h" | 20 | #include "event.h" |
21 | #include "session.h" | ||
22 | 21 | ||
23 | union perf_event; | 22 | union perf_event; |
24 | struct perf_session; | 23 | struct perf_session; |
@@ -380,6 +379,8 @@ struct addr_filters { | |||
380 | int cnt; | 379 | int cnt; |
381 | }; | 380 | }; |
382 | 381 | ||
382 | struct auxtrace_cache; | ||
383 | |||
383 | #ifdef HAVE_AUXTRACE_SUPPORT | 384 | #ifdef HAVE_AUXTRACE_SUPPORT |
384 | 385 | ||
385 | /* | 386 | /* |
@@ -549,41 +550,11 @@ int addr_filters__parse_bare_filter(struct addr_filters *filts, | |||
549 | const char *filter); | 550 | const char *filter); |
550 | int auxtrace_parse_filters(struct evlist *evlist); | 551 | int auxtrace_parse_filters(struct evlist *evlist); |
551 | 552 | ||
552 | static inline int auxtrace__process_event(struct perf_session *session, | 553 | int auxtrace__process_event(struct perf_session *session, union perf_event *event, |
553 | union perf_event *event, | 554 | struct perf_sample *sample, struct perf_tool *tool); |
554 | struct perf_sample *sample, | 555 | int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool); |
555 | struct perf_tool *tool) | 556 | void auxtrace__free_events(struct perf_session *session); |
556 | { | 557 | void auxtrace__free(struct perf_session *session); |
557 | if (!session->auxtrace) | ||
558 | return 0; | ||
559 | |||
560 | return session->auxtrace->process_event(session, event, sample, tool); | ||
561 | } | ||
562 | |||
563 | static inline int auxtrace__flush_events(struct perf_session *session, | ||
564 | struct perf_tool *tool) | ||
565 | { | ||
566 | if (!session->auxtrace) | ||
567 | return 0; | ||
568 | |||
569 | return session->auxtrace->flush_events(session, tool); | ||
570 | } | ||
571 | |||
572 | static inline void auxtrace__free_events(struct perf_session *session) | ||
573 | { | ||
574 | if (!session->auxtrace) | ||
575 | return; | ||
576 | |||
577 | return session->auxtrace->free_events(session); | ||
578 | } | ||
579 | |||
580 | static inline void auxtrace__free(struct perf_session *session) | ||
581 | { | ||
582 | if (!session->auxtrace) | ||
583 | return; | ||
584 | |||
585 | return session->auxtrace->free(session); | ||
586 | } | ||
587 | 558 | ||
588 | #define ITRACE_HELP \ | 559 | #define ITRACE_HELP \ |
589 | " i: synthesize instructions events\n" \ | 560 | " i: synthesize instructions events\n" \ |
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index c1a57323e25d..37283e865352 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/zalloc.h> | 15 | #include <linux/zalloc.h> |
16 | #include <errno.h> | 16 | #include <errno.h> |
17 | #include <stdlib.h> | ||
17 | #include "debug.h" | 18 | #include "debug.h" |
18 | #include "evlist.h" | 19 | #include "evlist.h" |
19 | #include "bpf-loader.h" | 20 | #include "bpf-loader.h" |
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c index 96a931c6f728..4881d4af3381 100644 --- a/tools/perf/util/cgroup.c +++ b/tools/perf/util/cgroup.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <sys/types.h> | 8 | #include <sys/types.h> |
9 | #include <sys/stat.h> | 9 | #include <sys/stat.h> |
10 | #include <fcntl.h> | 10 | #include <fcntl.h> |
11 | #include <stdlib.h> | ||
12 | #include <string.h> | ||
11 | 13 | ||
12 | int nr_cgroups; | 14 | int nr_cgroups; |
13 | 15 | ||
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 7ebf9e31ae22..0bc9c4d7fdc5 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "debug.h" | 23 | #include "debug.h" |
24 | #include <sys/types.h> | 24 | #include <sys/types.h> |
25 | #include <sys/stat.h> | 25 | #include <sys/stat.h> |
26 | #include <stdlib.h> | ||
26 | #include <unistd.h> | 27 | #include <unistd.h> |
27 | #include <linux/string.h> | 28 | #include <linux/string.h> |
28 | #include <linux/zalloc.h> | 29 | #include <linux/zalloc.h> |
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 30c2048ce67d..0174ecf757d7 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "machine.h" | 27 | #include "machine.h" |
28 | #include "map.h" | 28 | #include "map.h" |
29 | #include "perf.h" | 29 | #include "perf.h" |
30 | #include "session.h" | ||
30 | #include "symbol.h" | 31 | #include "symbol.h" |
31 | #include "tool.h" | 32 | #include "tool.h" |
32 | #include "thread.h" | 33 | #include "thread.h" |
diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h index bc848fd095f4..650ecc2a6349 100644 --- a/tools/perf/util/cs-etm.h +++ b/tools/perf/util/cs-etm.h | |||
@@ -8,9 +8,10 @@ | |||
8 | #define INCLUDE__UTIL_PERF_CS_ETM_H__ | 8 | #define INCLUDE__UTIL_PERF_CS_ETM_H__ |
9 | 9 | ||
10 | #include "util/event.h" | 10 | #include "util/event.h" |
11 | #include "util/session.h" | ||
12 | #include <linux/bits.h> | 11 | #include <linux/bits.h> |
13 | 12 | ||
13 | struct perf_session; | ||
14 | |||
14 | /* Versionning header in case things need tro change in the future. That way | 15 | /* Versionning header in case things need tro change in the future. That way |
15 | * decoding of old snapshot is still possible. | 16 | * decoding of old snapshot is still possible. |
16 | */ | 17 | */ |
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index ece97209792d..e11ddf86f2b3 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -10,9 +10,11 @@ | |||
10 | #include <unistd.h> | 10 | #include <unistd.h> |
11 | #include <errno.h> | 11 | #include <errno.h> |
12 | #include <fcntl.h> | 12 | #include <fcntl.h> |
13 | #include <stdlib.h> | ||
13 | #include <bpf/libbpf.h> | 14 | #include <bpf/libbpf.h> |
14 | #include "bpf-event.h" | 15 | #include "bpf-event.h" |
15 | #include "compress.h" | 16 | #include "compress.h" |
17 | #include "env.h" | ||
16 | #include "namespaces.h" | 18 | #include "namespaces.h" |
17 | #include "path.h" | 19 | #include "path.h" |
18 | #include "map.h" | 20 | #include "map.h" |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index b5d6d6ec9a9b..095924aa186b 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <signal.h> | 23 | #include <signal.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | #include <sched.h> | 25 | #include <sched.h> |
26 | #include <stdlib.h> | ||
26 | 27 | ||
27 | #include "parse-events.h" | 28 | #include "parse-events.h" |
28 | #include <subcmd/parse-options.h> | 29 | #include <subcmd/parse-options.h> |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index b6b406a1678f..85825384f9e8 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <sys/resource.h> | 22 | #include <sys/resource.h> |
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <dirent.h> | 24 | #include <dirent.h> |
25 | #include <stdlib.h> | ||
25 | #include <perf/evsel.h> | 26 | #include <perf/evsel.h> |
26 | #include "asm/bug.h" | 27 | #include "asm/bug.h" |
27 | #include "callchain.h" | 28 | #include "callchain.h" |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 003025465198..6a77aefbe319 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -3,9 +3,11 @@ | |||
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | #include <inttypes.h> | 4 | #include <inttypes.h> |
5 | #include <regex.h> | 5 | #include <regex.h> |
6 | #include <stdlib.h> | ||
6 | #include "callchain.h" | 7 | #include "callchain.h" |
7 | #include "debug.h" | 8 | #include "debug.h" |
8 | #include "dso.h" | 9 | #include "dso.h" |
10 | #include "env.h" | ||
9 | #include "event.h" | 11 | #include "event.h" |
10 | #include "evsel.h" | 12 | #include "evsel.h" |
11 | #include "hist.h" | 13 | #include "hist.h" |
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 28477ff5114e..33c5b5495482 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c | |||
@@ -10,9 +10,12 @@ | |||
10 | #include <inttypes.h> | 10 | #include <inttypes.h> |
11 | #include <asm/bug.h> | 11 | #include <asm/bug.h> |
12 | #include <linux/zalloc.h> | 12 | #include <linux/zalloc.h> |
13 | #include <stdlib.h> | ||
14 | #include <string.h> | ||
13 | #ifdef HAVE_LIBNUMA_SUPPORT | 15 | #ifdef HAVE_LIBNUMA_SUPPORT |
14 | #include <numaif.h> | 16 | #include <numaif.h> |
15 | #endif | 17 | #endif |
18 | #include "cpumap.h" | ||
16 | #include "debug.h" | 19 | #include "debug.h" |
17 | #include "event.h" | 20 | #include "event.h" |
18 | #include "mmap.h" | 21 | #include "mmap.h" |
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index 274ce389cd84..3857a49e8f96 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/ring_buffer.h> | 7 | #include <linux/ring_buffer.h> |
8 | #include <stdbool.h> | 8 | #include <stdbool.h> |
9 | #include <pthread.h> // for cpu_set_t | ||
9 | #ifdef HAVE_AIO_SUPPORT | 10 | #ifdef HAVE_AIO_SUPPORT |
10 | #include <aio.h> | 11 | #include <aio.h> |
11 | #endif | 12 | #endif |
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 9b350482c403..07ca4535e6f7 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <poll.h> | 5 | #include <poll.h> |
6 | #include <linux/err.h> | 6 | #include <linux/err.h> |
7 | #include <perf/cpumap.h> | 7 | #include <perf/cpumap.h> |
8 | #include <traceevent/event-parse.h> | ||
8 | #include "debug.h" | 9 | #include "debug.h" |
9 | #include "evlist.h" | 10 | #include "evlist.h" |
10 | #include "callchain.h" | 11 | #include "callchain.h" |
@@ -13,6 +14,7 @@ | |||
13 | #include "cpumap.h" | 14 | #include "cpumap.h" |
14 | #include "print_binary.h" | 15 | #include "print_binary.h" |
15 | #include "thread_map.h" | 16 | #include "thread_map.h" |
17 | #include "trace-event.h" | ||
16 | #include "mmap.h" | 18 | #include "mmap.h" |
17 | #include "util.h" | 19 | #include "util.h" |
18 | #include "../perf-sys.h" | 20 | #include "../perf-sys.h" |
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index ccad796bce5f..286fe816c0f3 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c | |||
@@ -5,6 +5,8 @@ | |||
5 | #include "cpumap.h" | 5 | #include "cpumap.h" |
6 | #include "parse-events.h" | 6 | #include "parse-events.h" |
7 | #include <errno.h> | 7 | #include <errno.h> |
8 | #include <limits.h> | ||
9 | #include <stdlib.h> | ||
8 | #include <api/fs/fs.h> | 10 | #include <api/fs/fs.h> |
9 | #include <subcmd/parse-options.h> | 11 | #include <subcmd/parse-options.h> |
10 | #include <perf/cpumap.h> | 12 | #include <perf/cpumap.h> |
diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c index d311c81464e5..0ddfa7b3e4f2 100644 --- a/tools/perf/util/s390-sample-raw.c +++ b/tools/perf/util/s390-sample-raw.c | |||
@@ -23,7 +23,6 @@ | |||
23 | 23 | ||
24 | #include "debug.h" | 24 | #include "debug.h" |
25 | #include "util.h" | 25 | #include "util.h" |
26 | #include "auxtrace.h" | ||
27 | #include "session.h" | 26 | #include "session.h" |
28 | #include "evlist.h" | 27 | #include "evlist.h" |
29 | #include "config.h" | 28 | #include "config.h" |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 32ade5a1b553..b974a2c3a3c5 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <errno.h> | 2 | #include <errno.h> |
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <regex.h> | 4 | #include <regex.h> |
5 | #include <stdlib.h> | ||
5 | #include <linux/mman.h> | 6 | #include <linux/mman.h> |
6 | #include <linux/time64.h> | 7 | #include <linux/time64.h> |
7 | #include "debug.h" | 8 | #include "debug.h" |
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 1461dac2322d..ed3b0ac2f785 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <stdlib.h> | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <inttypes.h> | 3 | #include <inttypes.h> |
3 | #include <linux/string.h> | 4 | #include <linux/string.h> |
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index f4a1edcec7b2..8f1ea27f976f 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -2,9 +2,12 @@ | |||
2 | #include <errno.h> | 2 | #include <errno.h> |
3 | #include <inttypes.h> | 3 | #include <inttypes.h> |
4 | #include <math.h> | 4 | #include <math.h> |
5 | #include <string.h> | ||
5 | #include "counts.h" | 6 | #include "counts.h" |
6 | #include "debug.h" | 7 | #include "debug.h" |
8 | #include "header.h" | ||
7 | #include "stat.h" | 9 | #include "stat.h" |
10 | #include "session.h" | ||
8 | #include "target.h" | 11 | #include "target.h" |
9 | #include "evlist.h" | 12 | #include "evlist.h" |
10 | #include "evsel.h" | 13 | #include "evsel.h" |
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index 7367433e767a..f117d4f4821e 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 "ordered-events.h" | ||
8 | #include "record.h" | 9 | #include "record.h" |
9 | #include <linux/types.h> | 10 | #include <linux/types.h> |
10 | #include <stddef.h> | 11 | #include <stddef.h> |