From: Ian Rogers Date: Mon, 14 Apr 2025 17:41:19 +0000 (-0700) Subject: perf intel-tpebs: Cleanup header X-Git-Tag: v6.16-rc1~57^2~152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb493c28e9ea029ff4f4986c6b45967e7fd679e6;p=thirdparty%2Flinux.git perf intel-tpebs: Cleanup header Remove arch conditional compilation. Arch conditional compilation belongs in the arch/ directory. Tidy header guards to match other files. Remove unneeded includes and switch to forward declarations when necesary. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Weilin Wang Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andreas Färber Cc: Caleb Biggers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Manivannan Sadhasivam Cc: Mark Rutland Cc: Maxime Coquelin Cc: Perry Taylor Cc: Peter Zijlstra Cc: Thomas Falcon Link: https://lore.kernel.org/r/20250414174134.3095492-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 946bce6628f37..815274b199fda 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -161,7 +161,7 @@ perf-util-y += clockid.o perf-util-y += list_sort.o perf-util-y += mutex.o perf-util-y += sharded_mutex.o -perf-util-$(CONFIG_X86_64) += intel-tpebs.o +perf-util-y += intel-tpebs.o perf-util-$(CONFIG_LIBBPF) += bpf_map.o perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c index 2c421b475b3b8..3503da28a12f8 100644 --- a/tools/perf/util/intel-tpebs.c +++ b/tools/perf/util/intel-tpebs.c @@ -19,6 +19,7 @@ #include "tool.h" #include "cpumap.h" #include "metricgroup.h" +#include "stat.h" #include #include #include diff --git a/tools/perf/util/intel-tpebs.h b/tools/perf/util/intel-tpebs.h index 766b3fbd79f12..63c16e759a71e 100644 --- a/tools/perf/util/intel-tpebs.h +++ b/tools/perf/util/intel-tpebs.h @@ -2,34 +2,16 @@ /* * intel_tpebs.h: Intel TEPBS support */ -#ifndef INCLUDE__PERF_INTEL_TPEBS_H__ -#define INCLUDE__PERF_INTEL_TPEBS_H__ +#ifndef __INTEL_TPEBS_H +#define __INTEL_TPEBS_H -#include "stat.h" -#include "evsel.h" - -#ifdef HAVE_ARCH_X86_64_SUPPORT +struct evlist; +struct evsel; extern bool tpebs_recording; + int tpebs_start(struct evlist *evsel_list); void tpebs_delete(void); int tpebs_set_evsel(struct evsel *evsel, int cpu_map_idx, int thread); -#else - -static inline int tpebs_start(struct evlist *evsel_list __maybe_unused) -{ - return 0; -} - -static inline void tpebs_delete(void) {}; - -static inline int tpebs_set_evsel(struct evsel *evsel __maybe_unused, - int cpu_map_idx __maybe_unused, - int thread __maybe_unused) -{ - return 0; -} - -#endif -#endif +#endif /* __INTEL_TPEBS_H */