Skip to contentSkip to conversation

perf intel-tpebs: Cleanup header

PATCH New Ian Rogers 2 participants 2 messages Dec 10, 2024 – Dec 14, 2024 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 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.

---
 tools/perf/util/Build         |  2 +-
 tools/perf/util/intel-tpebs.h | 30 ++++++------------------------
 2 files changed, 7 insertions(+), 25 deletions(-)
tools/perf/util/Build +1 -1
index 9eb8b1c3df94..c0ccd8ef08e0 100644
@@ -158,7 +158,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
tools/perf/util/intel-tpebs.h +6 -24
index 766b3fbd79f1..63c16e759a71 100644
@@ -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 */
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
#1 lore raw
kernel test robot noticed the following build errors:

Hi Ian,

kernel test robot noticed the following build errors:

[auto build test ERROR on perf-tools-next/perf-tools-next]
[also build test ERROR on tip/perf/core perf-tools/perf-tools linus/master v6.13-rc2 next-20241213] [cannot apply to acme/perf/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/perf-intel-tpebs-Cleanup-header/20241211-032044
base:   https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
patch link:    https://lore.kernel.org/r/20241210191823.612631-1-irogers%40google.com
patch subject: [PATCH v1] perf intel-tpebs: Cleanup header
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

     PERF_VERSION = 6.13.rc1.g19e7440f1089
>> util/intel-tpebs.c:358:10: error: call to undeclared function 'perf_counts'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     358 |         count = perf_counts(evsel->counts, cpu_map_idx, thread);
         |                 ^
>> util/intel-tpebs.c:358:8: error: incompatible integer to pointer conversion assigning to 'struct perf_counts_values *' from 'int' [-Wint-conversion]
     358 |         count = perf_counts(evsel->counts, cpu_map_idx, thread);
         |               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2 errors generated.
make[7]: *** [tools/build/Makefile.build:105: tools/perf/util/intel-tpebs.o] Error 1 make[7]: *** Waiting for unfinished jobs....
make[6]: *** [tools/build/Makefile.build:158: util] Error 2
make[5]: *** [Makefile.perf:789: tools/perf/perf-util-in.o] Error 2 make[5]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile.perf:292: sub-make] Error 2
make[3]: *** [Makefile:76: all] Error 2

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki