Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf auxtrace: Uninline functions that touch perf_session

So that we don't carry the session.h include directive in auxtrace.h,
which in turn opens a can of worms of files that were getting all sorts
of things via that include, fix them all.

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-d2d83aovpgri2z75wlitquni@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+98 -38
+1
tools/perf/arch/arm/annotate/instructions.c
··· 3 3 #include <linux/zalloc.h> 4 4 #include <sys/types.h> 5 5 #include <regex.h> 6 + #include <stdlib.h> 6 7 7 8 struct arm_annotate { 8 9 regex_t call_insn,
+1
tools/perf/arch/arm/util/cs-etm.c
··· 26 26 #include "../../util/pmu.h" 27 27 #include "../../util/cs-etm.h" 28 28 #include "../../util/util.h" 29 + #include "../../util/session.h" 29 30 30 31 #include <errno.h> 31 32 #include <stdlib.h>
+1
tools/perf/arch/arm64/annotate/instructions.c
··· 2 2 #include <linux/compiler.h> 3 3 #include <sys/types.h> 4 4 #include <regex.h> 5 + #include <stdlib.h> 5 6 6 7 struct arm64_annotate { 7 8 regex_t call_insn,
+1
tools/perf/arch/x86/tests/perf-time-to-tsc.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <errno.h> 3 3 #include <inttypes.h> 4 + #include <limits.h> 4 5 #include <stdbool.h> 5 6 #include <stdio.h> 6 7 #include <unistd.h>
+1
tools/perf/builtin-ftrace.c
··· 10 10 #include <errno.h> 11 11 #include <unistd.h> 12 12 #include <signal.h> 13 + #include <stdlib.h> 13 14 #include <fcntl.h> 14 15 #include <poll.h> 15 16 #include <linux/capability.h>
+1
tools/perf/tests/backward-ring-buffer.c
··· 9 9 #include "record.h" 10 10 #include "tests.h" 11 11 #include "debug.h" 12 + #include "parse-events.h" 12 13 #include <errno.h> 13 14 #include <linux/string.h> 14 15
+1
tools/perf/tests/bpf.c
··· 18 18 #include "tests.h" 19 19 #include "llvm.h" 20 20 #include "debug.h" 21 + #include "parse-events.h" 21 22 #define NR_ITERS 111 22 23 #define PERF_TEST_BPF_PATH "/sys/fs/bpf/perf_test" 23 24
+1
tools/perf/tests/builtin-test.c
··· 8 8 #include <errno.h> 9 9 #include <unistd.h> 10 10 #include <string.h> 11 + #include <stdlib.h> 11 12 #include <sys/types.h> 12 13 #include <dirent.h> 13 14 #include <sys/wait.h>
+6
tools/perf/tests/code-reading.c
··· 13 13 14 14 #include "debug.h" 15 15 #include "dso.h" 16 + #include "env.h" 16 17 #include "parse-events.h" 18 + #include "trace-event.h" 17 19 #include "evlist.h" 18 20 #include "evsel.h" 19 21 #include "thread_map.h" ··· 497 495 } 498 496 } 499 497 } 498 + 499 + #ifdef __s390x__ 500 + #include "header.h" // for get_cpuid() 501 + #endif 500 502 501 503 static const char *do_determine_event(bool excl_kernel) 502 504 {
+1
tools/perf/tests/event-times.c
··· 11 11 #include "evsel.h" 12 12 #include "util.h" 13 13 #include "debug.h" 14 + #include "parse-events.h" 14 15 #include "thread_map.h" 15 16 #include "target.h" 16 17
+2
tools/perf/tests/event_update.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/compiler.h> 3 3 #include <perf/cpumap.h> 4 + #include <string.h> 4 5 #include "evlist.h" 5 6 #include "evsel.h" 7 + #include "header.h" 6 8 #include "machine.h" 7 9 #include "tool.h" 8 10 #include "tests.h"
+1
tools/perf/tests/keep-tracking.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/types.h> 3 + #include <limits.h> 3 4 #include <unistd.h> 4 5 #include <sys/prctl.h> 5 6 #include <perf/cpumap.h>
+1
tools/perf/tests/mmap-basic.c
··· 3 3 #include <inttypes.h> 4 4 /* For the CLR_() macros */ 5 5 #include <pthread.h> 6 + #include <stdlib.h> 6 7 #include <perf/cpumap.h> 7 8 8 9 #include "debug.h"
+1
tools/perf/tests/parse-events.c
··· 5 5 #include <api/fs/fs.h> 6 6 #include "tests.h" 7 7 #include "debug.h" 8 + #include "pmu.h" 8 9 #include "util.h" 9 10 #include <dirent.h> 10 11 #include <errno.h>
+1
tools/perf/tests/switch-tracking.c
··· 2 2 #include <sys/time.h> 3 3 #include <sys/prctl.h> 4 4 #include <errno.h> 5 + #include <limits.h> 5 6 #include <time.h> 6 7 #include <stdlib.h> 7 8 #include <linux/zalloc.h>
+1
tools/perf/ui/browsers/hists.c
··· 16 16 #include "../../util/callchain.h" 17 17 #include "../../util/evsel.h" 18 18 #include "../../util/evlist.h" 19 + #include "../../util/header.h" 19 20 #include "../../util/hist.h" 20 21 #include "../../util/map.h" 21 22 #include "../../util/symbol.h"
+2
tools/perf/ui/browsers/res_sample.c
··· 9 9 #include "../util.h" 10 10 #include "../../util/util.h" 11 11 #include "../../perf.h" 12 + #include <stdlib.h> 13 + #include <string.h> 12 14 #include <linux/time64.h> 13 15 #include <linux/zalloc.h> 14 16
+1
tools/perf/ui/browsers/scripts.c
··· 10 10 #include "config.h" 11 11 #include <linux/string.h> 12 12 #include <linux/zalloc.h> 13 + #include <stdlib.h> 13 14 14 15 #define SCRIPT_NAMELEN 128 15 16 #define SCRIPT_MAX_NO 64
+2
tools/perf/ui/hist.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <inttypes.h> 3 3 #include <math.h> 4 + #include <stdlib.h> 5 + #include <string.h> 4 6 #include <linux/compiler.h> 5 7 6 8 #include "../util/callchain.h"
+1
tools/perf/ui/stdio/hist.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <stdio.h> 3 + #include <stdlib.h> 3 4 #include <linux/string.h> 4 5 5 6 #include "../../util/callchain.h"
+3
tools/perf/util/annotate.c
··· 9 9 #include <errno.h> 10 10 #include <inttypes.h> 11 11 #include <libgen.h> 12 + #include <stdlib.h> 12 13 #include <bpf/bpf.h> 13 14 #include <bpf/btf.h> 14 15 #include <bpf/libbpf.h> ··· 21 20 #include "color.h" 22 21 #include "config.h" 23 22 #include "dso.h" 23 + #include "env.h" 24 24 #include "map.h" 25 + #include "map_groups.h" 25 26 #include "symbol.h" 26 27 #include "srcline.h" 27 28 #include "units.h"
+33
tools/perf/util/auxtrace.c
··· 2196 2196 2197 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 + }
+7 -36
tools/perf/util/auxtrace.h
··· 18 18 #include <asm/barrier.h> 19 19 20 20 #include "event.h" 21 - #include "session.h" 22 21 23 22 union perf_event; 24 23 struct perf_session; ··· 379 380 int cnt; 380 381 }; 381 382 383 + struct auxtrace_cache; 384 + 382 385 #ifdef HAVE_AUXTRACE_SUPPORT 383 386 384 387 /* ··· 550 549 const char *filter); 551 550 int auxtrace_parse_filters(struct evlist *evlist); 552 551 553 - static inline int auxtrace__process_event(struct perf_session *session, 554 - union perf_event *event, 555 - struct perf_sample *sample, 556 - struct perf_tool *tool) 557 - { 558 - if (!session->auxtrace) 559 - return 0; 560 - 561 - return session->auxtrace->process_event(session, event, sample, tool); 562 - } 563 - 564 - static inline int auxtrace__flush_events(struct perf_session *session, 565 - struct perf_tool *tool) 566 - { 567 - if (!session->auxtrace) 568 - return 0; 569 - 570 - return session->auxtrace->flush_events(session, tool); 571 - } 572 - 573 - static inline void auxtrace__free_events(struct perf_session *session) 574 - { 575 - if (!session->auxtrace) 576 - return; 577 - 578 - return session->auxtrace->free_events(session); 579 - } 580 - 581 - static inline void auxtrace__free(struct perf_session *session) 582 - { 583 - if (!session->auxtrace) 584 - return; 585 - 586 - return session->auxtrace->free(session); 587 - } 552 + int auxtrace__process_event(struct perf_session *session, union perf_event *event, 553 + struct perf_sample *sample, struct perf_tool *tool); 554 + int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool); 555 + void auxtrace__free_events(struct perf_session *session); 556 + void auxtrace__free(struct perf_session *session); 588 557 589 558 #define ITRACE_HELP \ 590 559 " i: synthesize instructions events\n" \
+1
tools/perf/util/bpf-loader.c
··· 14 14 #include <linux/string.h> 15 15 #include <linux/zalloc.h> 16 16 #include <errno.h> 17 + #include <stdlib.h> 17 18 #include "debug.h" 18 19 #include "evlist.h" 19 20 #include "bpf-loader.h"
+2
tools/perf/util/cgroup.c
··· 8 8 #include <sys/types.h> 9 9 #include <sys/stat.h> 10 10 #include <fcntl.h> 11 + #include <stdlib.h> 12 + #include <string.h> 11 13 12 14 int nr_cgroups; 13 15
+1
tools/perf/util/config.c
··· 23 23 #include "debug.h" 24 24 #include <sys/types.h> 25 25 #include <sys/stat.h> 26 + #include <stdlib.h> 26 27 #include <unistd.h> 27 28 #include <linux/string.h> 28 29 #include <linux/zalloc.h>
+1
tools/perf/util/cs-etm.c
··· 27 27 #include "machine.h" 28 28 #include "map.h" 29 29 #include "perf.h" 30 + #include "session.h" 30 31 #include "symbol.h" 31 32 #include "tool.h" 32 33 #include "thread.h"
+2 -1
tools/perf/util/cs-etm.h
··· 8 8 #define INCLUDE__UTIL_PERF_CS_ETM_H__ 9 9 10 10 #include "util/event.h" 11 - #include "util/session.h" 12 11 #include <linux/bits.h> 12 + 13 + struct perf_session; 13 14 14 15 /* Versionning header in case things need tro change in the future. That way 15 16 * decoding of old snapshot is still possible.
+2
tools/perf/util/dso.c
··· 10 10 #include <unistd.h> 11 11 #include <errno.h> 12 12 #include <fcntl.h> 13 + #include <stdlib.h> 13 14 #include <bpf/libbpf.h> 14 15 #include "bpf-event.h" 15 16 #include "compress.h" 17 + #include "env.h" 16 18 #include "namespaces.h" 17 19 #include "path.h" 18 20 #include "map.h"
+1
tools/perf/util/evlist.c
··· 23 23 #include <signal.h> 24 24 #include <unistd.h> 25 25 #include <sched.h> 26 + #include <stdlib.h> 26 27 27 28 #include "parse-events.h" 28 29 #include <subcmd/parse-options.h>
+1
tools/perf/util/evsel.c
··· 22 22 #include <sys/resource.h> 23 23 #include <sys/types.h> 24 24 #include <dirent.h> 25 + #include <stdlib.h> 25 26 #include <perf/evsel.h> 26 27 #include "asm/bug.h" 27 28 #include "callchain.h"
+2
tools/perf/util/machine.c
··· 3 3 #include <errno.h> 4 4 #include <inttypes.h> 5 5 #include <regex.h> 6 + #include <stdlib.h> 6 7 #include "callchain.h" 7 8 #include "debug.h" 8 9 #include "dso.h" 10 + #include "env.h" 9 11 #include "event.h" 10 12 #include "evsel.h" 11 13 #include "hist.h"
+3
tools/perf/util/mmap.c
··· 10 10 #include <inttypes.h> 11 11 #include <asm/bug.h> 12 12 #include <linux/zalloc.h> 13 + #include <stdlib.h> 14 + #include <string.h> 13 15 #ifdef HAVE_LIBNUMA_SUPPORT 14 16 #include <numaif.h> 15 17 #endif 18 + #include "cpumap.h" 16 19 #include "debug.h" 17 20 #include "event.h" 18 21 #include "mmap.h"
+1
tools/perf/util/mmap.h
··· 6 6 #include <linux/types.h> 7 7 #include <linux/ring_buffer.h> 8 8 #include <stdbool.h> 9 + #include <pthread.h> // for cpu_set_t 9 10 #ifdef HAVE_AIO_SUPPORT 10 11 #include <aio.h> 11 12 #endif
+2
tools/perf/util/python.c
··· 5 5 #include <poll.h> 6 6 #include <linux/err.h> 7 7 #include <perf/cpumap.h> 8 + #include <traceevent/event-parse.h> 8 9 #include "debug.h" 9 10 #include "evlist.h" 10 11 #include "callchain.h" ··· 14 13 #include "cpumap.h" 15 14 #include "print_binary.h" 16 15 #include "thread_map.h" 16 + #include "trace-event.h" 17 17 #include "mmap.h" 18 18 #include "util.h" 19 19 #include "../perf-sys.h"
+2
tools/perf/util/record.c
··· 5 5 #include "cpumap.h" 6 6 #include "parse-events.h" 7 7 #include <errno.h> 8 + #include <limits.h> 9 + #include <stdlib.h> 8 10 #include <api/fs/fs.h> 9 11 #include <subcmd/parse-options.h> 10 12 #include <perf/cpumap.h>
-1
tools/perf/util/s390-sample-raw.c
··· 23 23 24 24 #include "debug.h" 25 25 #include "util.h" 26 - #include "auxtrace.h" 27 26 #include "session.h" 28 27 #include "evlist.h" 29 28 #include "config.h"
+1
tools/perf/util/sort.c
··· 2 2 #include <errno.h> 3 3 #include <inttypes.h> 4 4 #include <regex.h> 5 + #include <stdlib.h> 5 6 #include <linux/mman.h> 6 7 #include <linux/time64.h> 7 8 #include "debug.h"
+1
tools/perf/util/stat-display.c
··· 1 + #include <stdlib.h> 1 2 #include <stdio.h> 2 3 #include <inttypes.h> 3 4 #include <linux/string.h>
+3
tools/perf/util/stat.c
··· 2 2 #include <errno.h> 3 3 #include <inttypes.h> 4 4 #include <math.h> 5 + #include <string.h> 5 6 #include "counts.h" 6 7 #include "debug.h" 8 + #include "header.h" 7 9 #include "stat.h" 10 + #include "session.h" 8 11 #include "target.h" 9 12 #include "evlist.h" 10 13 #include "evsel.h"
+1
tools/perf/util/top.h
··· 5 5 #include "tool.h" 6 6 #include "evswitch.h" 7 7 #include "annotate.h" 8 + #include "ordered-events.h" 8 9 #include "record.h" 9 10 #include <linux/types.h> 10 11 #include <stddef.h>