linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/5] Remove NO_AUXTRACE build option
@ 2025-11-10  1:31 Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 1/5] perf intel-pt: Use the perf provided "cpuid.h" Ian Rogers
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

Switch the __get_cpuid feature for intel-pt to use the provided cpuid
function in perf, this removes the need for NO_AUXTRACE when the
feature detection fails. Remove the now unnecessary feature
detection. Remove NO_AUXTRACE as it just builds a more broken version
of perf and isn't guarding dependencies on any libraries, etc. Clean
up headers files for auxtrace.h.

This was prompted by needing to make a v2 patch set of:
https://lore.kernel.org/lkml/20251107170712.2302714-1-irogers@google.com/
due to a broken NO_AUXTRACE configuration.

Ian Rogers (5):
  perf intel-pt: Use the perf provided "cpuid.h"
  perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid
  tool build: Remove __get_cpuid feature test
  perf build: Remove NO_AUXTRACE build option
  perf auxtrace: Remove errno.h from auxtrace.h and fix transitive
    dependencies

 tools/build/Makefile.feature                  |   2 -
 tools/build/feature/Makefile                  |   4 -
 tools/build/feature/test-all.c                |   5 -
 tools/build/feature/test-get_cpuid.c          |   8 -
 tools/perf/Documentation/perf-check.txt       |   1 -
 tools/perf/Makefile.config                    |  13 --
 tools/perf/Makefile.perf                      |   2 -
 tools/perf/arch/arm/annotate/instructions.c   |   1 +
 tools/perf/arch/arm/util/Build                |   2 +-
 tools/perf/arch/arm/util/auxtrace.c           |   1 +
 tools/perf/arch/arm/util/pmu.c                |   2 -
 tools/perf/arch/arm64/annotate/instructions.c |   1 +
 tools/perf/arch/arm64/util/Build              |  19 +-
 tools/perf/arch/arm64/util/arm-spe.c          |   1 +
 tools/perf/arch/arm64/util/hisi-ptt.c         |   1 +
 tools/perf/arch/powerpc/util/Build            |   2 +-
 tools/perf/arch/powerpc/util/auxtrace.c       |   2 +-
 tools/perf/arch/s390/util/Build               |   2 +-
 tools/perf/arch/s390/util/auxtrace.c          |   1 +
 tools/perf/arch/x86/tests/Build               |   4 +-
 tools/perf/arch/x86/tests/arch-tests.c        |   4 -
 tools/perf/arch/x86/tests/intel-pt-test.c     |   6 +-
 tools/perf/arch/x86/tests/topdown.c           |   1 +
 tools/perf/arch/x86/util/Build                |   6 +-
 tools/perf/arch/x86/util/intel-pt.c           |   4 +-
 tools/perf/arch/x86/util/pmu.c                |   2 -
 tools/perf/arch/x86/util/topdown.c            |   1 +
 tools/perf/bench/evlist-open-close.c          |   1 +
 tools/perf/bench/futex.c                      |   1 +
 tools/perf/bench/pmu-scan.c                   |   1 +
 tools/perf/bench/synthesize.c                 |   1 +
 tools/perf/builtin-check.c                    |   1 -
 tools/perf/builtin-inject.c                   |  15 --
 tools/perf/builtin-mem.c                      |   1 +
 tools/perf/builtin-record.c                   |  36 ---
 tools/perf/builtin-script.c                   |  12 -
 tools/perf/tests/hwmon_pmu.c                  |   1 +
 tools/perf/tests/make                         |   4 +-
 tools/perf/tests/parse-metric.c               |   1 +
 tools/perf/tests/pfm.c                        |   1 +
 tools/perf/ui/hist.c                          |   1 +
 tools/perf/util/Build                         |  24 +-
 tools/perf/util/annotate-data.c               |   2 +-
 tools/perf/util/arm-spe-decoder/Build         |   2 +-
 tools/perf/util/auxtrace.h                    | 221 +-----------------
 tools/perf/util/bpf-filter.h                  |   2 +
 tools/perf/util/bpf-trace-summary.c           |   1 +
 tools/perf/util/bpf_counter_cgroup.c          |   1 +
 tools/perf/util/bpf_ftrace.c                  |   3 +-
 tools/perf/util/bpf_map.c                     |   1 +
 tools/perf/util/cgroup.c                      |   1 +
 tools/perf/util/cs-etm-decoder/Build          |   2 +-
 tools/perf/util/drm_pmu.c                     |   1 +
 tools/perf/util/evswitch.c                    |   1 +
 tools/perf/util/hisi-ptt-decoder/Build        |   2 +-
 tools/perf/util/intel-pt-decoder/Build        |   8 +-
 tools/perf/util/intel-tpebs.c                 |   1 +
 tools/perf/util/kvm-stat.h                    |   1 +
 tools/perf/util/mmap.c                        |   1 +
 tools/perf/util/pfm.c                         |   1 +
 tools/perf/util/powerpc-vpadtl.c              |   1 +
 tools/perf/util/stat-shadow.c                 |   1 +
 tools/perf/util/synthetic-events.h            |  15 --
 63 files changed, 77 insertions(+), 391 deletions(-)
 delete mode 100644 tools/build/feature/test-get_cpuid.c

-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v1 1/5] perf intel-pt: Use the perf provided "cpuid.h"
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
@ 2025-11-10  1:31 ` Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 2/5] perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid Ian Rogers
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

Rather than having a feature test and include of <cpuid.h> for the
__get_cpuid function, use the cpuid function provided by
tools/perf/arch/x86/util/cpuid.h.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/arch/x86/tests/intel-pt-test.c | 6 +++---
 tools/perf/arch/x86/util/intel-pt.c       | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/arch/x86/tests/intel-pt-test.c b/tools/perf/arch/x86/tests/intel-pt-test.c
index b217ed67cd4e..970997759ec2 100644
--- a/tools/perf/arch/x86/tests/intel-pt-test.c
+++ b/tools/perf/arch/x86/tests/intel-pt-test.c
@@ -3,7 +3,6 @@
 #include <linux/compiler.h>
 #include <linux/bits.h>
 #include <string.h>
-#include <cpuid.h>
 #include <sched.h>
 
 #include "intel-pt-decoder/intel-pt-pkt-decoder.h"
@@ -11,6 +10,7 @@
 #include "debug.h"
 #include "tests/tests.h"
 #include "arch-tests.h"
+#include "../util/cpuid.h"
 #include "cpumap.h"
 
 /**
@@ -363,7 +363,7 @@ static int get_pt_caps(int cpu, struct pt_caps *caps)
 	memset(caps, 0, sizeof(*caps));
 
 	for (i = 0; i < INTEL_PT_SUBLEAF_CNT; i++) {
-		__get_cpuid_count(20, i, &r.eax, &r.ebx, &r.ecx, &r.edx);
+		cpuid(20, i, &r.eax, &r.ebx, &r.ecx, &r.edx);
 		pr_debug("CPU %d CPUID leaf 20 subleaf %d\n", cpu, i);
 		pr_debug("eax = 0x%08x\n", r.eax);
 		pr_debug("ebx = 0x%08x\n", r.ebx);
@@ -380,7 +380,7 @@ static bool is_hybrid(void)
 	unsigned int eax, ebx, ecx, edx = 0;
 	bool result;
 
-	__get_cpuid_count(7, 0, &eax, &ebx, &ecx, &edx);
+	cpuid(7, 0, &eax, &ebx, &ecx, &edx);
 	result = edx & BIT(15);
 	pr_debug("Is %shybrid : CPUID leaf 7 subleaf 0 edx %#x (bit-15 indicates hybrid)\n",
 		 result ? "" : "not ", edx);
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index 2d7c0dec86b0..b394ad9cc635 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -12,7 +12,6 @@
 #include <linux/log2.h>
 #include <linux/zalloc.h>
 #include <linux/err.h>
-#include <cpuid.h>
 
 #include "../../../util/session.h"
 #include "../../../util/event.h"
@@ -34,6 +33,7 @@
 #include <internal/lib.h> // page_size
 #include "../../../util/intel-pt.h"
 #include <api/fs/fs.h>
+#include "cpuid.h"
 
 #define KiB(x) ((x) * 1024)
 #define MiB(x) ((x) * 1024 * 1024)
@@ -311,7 +311,7 @@ static void intel_pt_tsc_ctc_ratio(u32 *n, u32 *d)
 {
 	unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
 
-	__get_cpuid(0x15, &eax, &ebx, &ecx, &edx);
+	cpuid(0x15, 0, &eax, &ebx, &ecx, &edx);
 	*n = ebx;
 	*d = eax;
 }
-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 2/5] perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 1/5] perf intel-pt: Use the perf provided "cpuid.h" Ian Rogers
@ 2025-11-10  1:31 ` Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 3/5] tool build: Remove __get_cpuid feature test Ian Rogers
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

The intel-pt code dependent on __get_cpuid is no longer present so
remove the feature test in the Makefile.config.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5700516aa84a..5decc3d5fef8 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1114,16 +1114,8 @@ ifndef NO_CAPSTONE
 endif
 
 ifndef NO_AUXTRACE
-  ifeq ($(SRCARCH),x86)
-    ifeq ($(feature-get_cpuid), 0)
-      $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc)
-      NO_AUXTRACE := 1
-    endif
-  endif
-  ifndef NO_AUXTRACE
-    $(call detected,CONFIG_AUXTRACE)
-    CFLAGS += -DHAVE_AUXTRACE_SUPPORT
-  endif
+  $(call detected,CONFIG_AUXTRACE)
+  CFLAGS += -DHAVE_AUXTRACE_SUPPORT
 endif
 
 ifdef EXTRA_TESTS
-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 3/5] tool build: Remove __get_cpuid feature test
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 1/5] perf intel-pt: Use the perf provided "cpuid.h" Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 2/5] perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid Ian Rogers
@ 2025-11-10  1:31 ` Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 4/5] perf build: Remove NO_AUXTRACE build option Ian Rogers
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

This feature test is no longer used so remove.

The function tested by the feature test is used in:
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
however, the Makefile just assumes the presence of the function and
doesn't perform a build feature test for it.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/build/Makefile.feature         | 2 --
 tools/build/feature/Makefile         | 4 ----
 tools/build/feature/test-all.c       | 5 -----
 tools/build/feature/test-get_cpuid.c | 8 --------
 4 files changed, 19 deletions(-)
 delete mode 100644 tools/build/feature/test-get_cpuid.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 32bbe29fe5f6..fc6abe369f73 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -90,7 +90,6 @@ FEATURE_TESTS_BASIC :=                  \
         timerfd                         \
         zlib                            \
         lzma                            \
-        get_cpuid                       \
         bpf                             \
         scandirat			\
         sched_getcpu			\
@@ -146,7 +145,6 @@ FEATURE_DISPLAY ?=              \
          llvm-perf              \
          zlib                   \
          lzma                   \
-         get_cpuid              \
          bpf			\
          libaio			\
          libzstd
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 49b0add392b1..7c90e0d0157a 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -56,7 +56,6 @@ FILES=                                          \
          test-lzma.bin                          \
          test-bpf.bin                           \
          test-libbpf.bin                        \
-         test-get_cpuid.bin                     \
          test-sdt.bin                           \
          test-cxx.bin                           \
          test-gettid.bin			\
@@ -318,9 +317,6 @@ $(OUTPUT)test-zlib.bin:
 $(OUTPUT)test-lzma.bin:
 	$(BUILD) -llzma
 
-$(OUTPUT)test-get_cpuid.bin:
-	$(BUILD)
-
 $(OUTPUT)test-bpf.bin:
 	$(BUILD)
 
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 8a354b81417c..eb346160d0ba 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -114,10 +114,6 @@
 # include "test-lzma.c"
 #undef main
 
-#define main main_test_get_cpuid
-# include "test-get_cpuid.c"
-#undef main
-
 #define main main_test_bpf
 # include "test-bpf.c"
 #undef main
@@ -168,7 +164,6 @@ int main(int argc, char *argv[])
 	main_test_pthread_attr_setaffinity_np();
 	main_test_pthread_barrier();
 	main_test_lzma();
-	main_test_get_cpuid();
 	main_test_bpf();
 	main_test_scandirat();
 	main_test_sched_getcpu();
diff --git a/tools/build/feature/test-get_cpuid.c b/tools/build/feature/test-get_cpuid.c
deleted file mode 100644
index bb4f065f28a6..000000000000
--- a/tools/build/feature/test-get_cpuid.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <cpuid.h>
-
-int main(void)
-{
-	unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
-	return __get_cpuid(0x15, &eax, &ebx, &ecx, &edx);
-}
-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 4/5] perf build: Remove NO_AUXTRACE build option
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
                   ` (2 preceding siblings ...)
  2025-11-10  1:31 ` [PATCH v1 3/5] tool build: Remove __get_cpuid feature test Ian Rogers
@ 2025-11-10  1:31 ` Ian Rogers
  2025-11-10  1:31 ` [PATCH v1 5/5] perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies Ian Rogers
  2025-11-11  6:21 ` [PATCH v1 0/5] Remove NO_AUXTRACE build option Namhyung Kim
  5 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

The NO_AUXTRACE build option was used when the __get_cpuid feature
test failed or if it was provided on the command line. The option no
longer avoids a dependency on a library and so having the option is
just adding complexity to the code base. Remove the option
CONFIG_AUXTRACE from Build files and HAVE_AUXTRACE_SUPPORT by assuming
it is always defined.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Documentation/perf-check.txt |   1 -
 tools/perf/Makefile.config              |   5 -
 tools/perf/Makefile.perf                |   2 -
 tools/perf/arch/arm/util/Build          |   2 +-
 tools/perf/arch/arm/util/pmu.c          |   2 -
 tools/perf/arch/arm64/util/Build        |  19 +-
 tools/perf/arch/powerpc/util/Build      |   2 +-
 tools/perf/arch/s390/util/Build         |   2 +-
 tools/perf/arch/x86/tests/Build         |   4 +-
 tools/perf/arch/x86/tests/arch-tests.c  |   4 -
 tools/perf/arch/x86/util/Build          |   6 +-
 tools/perf/arch/x86/util/pmu.c          |   2 -
 tools/perf/builtin-check.c              |   1 -
 tools/perf/builtin-inject.c             |  15 --
 tools/perf/builtin-record.c             |  36 ----
 tools/perf/builtin-script.c             |  12 --
 tools/perf/tests/make                   |   4 +-
 tools/perf/util/Build                   |  24 +--
 tools/perf/util/arm-spe-decoder/Build   |   2 +-
 tools/perf/util/auxtrace.h              | 220 +-----------------------
 tools/perf/util/cs-etm-decoder/Build    |   2 +-
 tools/perf/util/hisi-ptt-decoder/Build  |   2 +-
 tools/perf/util/intel-pt-decoder/Build  |   8 +-
 tools/perf/util/synthetic-events.h      |  15 --
 24 files changed, 37 insertions(+), 355 deletions(-)

diff --git a/tools/perf/Documentation/perf-check.txt b/tools/perf/Documentation/perf-check.txt
index 4c9ccda6ce91..09e1d35677f5 100644
--- a/tools/perf/Documentation/perf-check.txt
+++ b/tools/perf/Documentation/perf-check.txt
@@ -50,7 +50,6 @@ feature::
                 dwarf                   /  HAVE_LIBDW_SUPPORT
                 dwarf_getlocations      /  HAVE_LIBDW_SUPPORT
                 dwarf-unwind            /  HAVE_DWARF_UNWIND_SUPPORT
-                auxtrace                /  HAVE_AUXTRACE_SUPPORT
                 libbfd                  /  HAVE_LIBBFD_SUPPORT
                 libbpf-strings          /  HAVE_LIBBPF_STRINGS_SUPPORT
                 libcapstone             /  HAVE_LIBCAPSTONE_SUPPORT
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5decc3d5fef8..6b62fea21a0a 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1113,11 +1113,6 @@ ifndef NO_CAPSTONE
   endif
 endif
 
-ifndef NO_AUXTRACE
-  $(call detected,CONFIG_AUXTRACE)
-  CFLAGS += -DHAVE_AUXTRACE_SUPPORT
-endif
-
 ifdef EXTRA_TESTS
     $(call detected,CONFIG_EXTRA_TESTS)
     CFLAGS += -DHAVE_EXTRA_TESTS
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index afeb4e4a8a31..80decc7ce13c 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -84,8 +84,6 @@ include ../scripts/utilities.mak
 #
 # Define NO_LZMA if you do not want to support compressed (xz) kernel modules
 #
-# Define NO_AUXTRACE if you do not want AUX area tracing support
-#
 # Define NO_LIBBPF if you do not want BPF support
 #
 # Define NO_LIBCAP if you do not want process capabilities considered by perf
diff --git a/tools/perf/arch/arm/util/Build b/tools/perf/arch/arm/util/Build
index f7a8b37d1c68..fd695e1fdaee 100644
--- a/tools/perf/arch/arm/util/Build
+++ b/tools/perf/arch/arm/util/Build
@@ -3,4 +3,4 @@ perf-util-y += perf_regs.o
 perf-util-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind.o
 perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
 
-perf-util-$(CONFIG_AUXTRACE) += pmu.o auxtrace.o cs-etm.o
+perf-util-y += pmu.o auxtrace.o cs-etm.o
diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c
index f70075c89aa0..9be8da5207f5 100644
--- a/tools/perf/arch/arm/util/pmu.c
+++ b/tools/perf/arch/arm/util/pmu.c
@@ -20,7 +20,6 @@ void perf_pmu__arch_init(struct perf_pmu *pmu)
 {
 	struct perf_cpu_map *intersect, *online = cpu_map__online();
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 	if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) {
 		/* add ETM default config here */
 		pmu->auxtrace = true;
@@ -39,7 +38,6 @@ void perf_pmu__arch_init(struct perf_pmu *pmu)
 		pmu->selectable = true;
 #endif
 	}
-#endif
 	/* Workaround some ARM PMU's failing to correctly set CPU maps for online processors. */
 	intersect = perf_cpu_map__intersect(online, pmu->cpus);
 	perf_cpu_map__put(online);
diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build
index a74521b79eaa..d63881081d2e 100644
--- a/tools/perf/arch/arm64/util/Build
+++ b/tools/perf/arch/arm64/util/Build
@@ -1,13 +1,14 @@
+perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
+perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o
+perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
+perf-util-y += ../../arm/util/auxtrace.o
+perf-util-y += ../../arm/util/cs-etm.o
+perf-util-y += ../../arm/util/pmu.o
+perf-util-y += arm-spe.o
 perf-util-y += header.o
+perf-util-y += hisi-ptt.o
 perf-util-y += machine.o
+perf-util-y += mem-events.o
 perf-util-y += perf_regs.o
-perf-util-y += tsc.o
 perf-util-y += pmu.o
-perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o
-perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
-perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
-
-perf-util-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \
-			      ../../arm/util/auxtrace.o \
-			      ../../arm/util/cs-etm.o \
-			      arm-spe.o mem-events.o hisi-ptt.o
+perf-util-y += tsc.o
diff --git a/tools/perf/arch/powerpc/util/Build b/tools/perf/arch/powerpc/util/Build
index a5b0babd307e..3d0d5427aef7 100644
--- a/tools/perf/arch/powerpc/util/Build
+++ b/tools/perf/arch/powerpc/util/Build
@@ -10,4 +10,4 @@ perf-util-$(CONFIG_LIBDW) += skip-callchain-idx.o
 
 perf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
 perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
-perf-util-$(CONFIG_AUXTRACE) += auxtrace.o
+perf-util-y += auxtrace.o
diff --git a/tools/perf/arch/s390/util/Build b/tools/perf/arch/s390/util/Build
index 736c0ad09194..c64eb18dbdae 100644
--- a/tools/perf/arch/s390/util/Build
+++ b/tools/perf/arch/s390/util/Build
@@ -7,4 +7,4 @@ perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
 perf-util-y += machine.o
 perf-util-y += pmu.o
 
-perf-util-$(CONFIG_AUXTRACE) += auxtrace.o
+perf-util-y += auxtrace.o
diff --git a/tools/perf/arch/x86/tests/Build b/tools/perf/arch/x86/tests/Build
index 7790b3e20f4e..b017d1ca6e3c 100644
--- a/tools/perf/arch/x86/tests/Build
+++ b/tools/perf/arch/x86/tests/Build
@@ -3,9 +3,9 @@ perf-test-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
 
 perf-test-y += arch-tests.o
 perf-test-y += hybrid.o
-perf-test-$(CONFIG_AUXTRACE) += intel-pt-test.o
+perf-test-y += intel-pt-test.o
 ifeq ($(CONFIG_EXTRA_TESTS),y)
-perf-test-$(CONFIG_AUXTRACE) += insn-x86.o
+perf-test-y += insn-x86.o
 endif
 perf-test-$(CONFIG_X86_64) += bp-modify.o
 perf-test-y += amd-ibs-via-core-pmu.o
diff --git a/tools/perf/arch/x86/tests/arch-tests.c b/tools/perf/arch/x86/tests/arch-tests.c
index 8f9cfeaa170f..c3e1619c5e79 100644
--- a/tools/perf/arch/x86/tests/arch-tests.c
+++ b/tools/perf/arch/x86/tests/arch-tests.c
@@ -3,7 +3,6 @@
 #include "tests/tests.h"
 #include "arch-tests.h"
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 #ifdef HAVE_EXTRA_TESTS
 DEFINE_SUITE("x86 instruction decoder - new instructions", insn_x86);
 #endif
@@ -19,7 +18,6 @@ struct test_suite suite__intel_pt = {
 	.test_cases = intel_pt_tests,
 };
 
-#endif
 #if defined(__x86_64__)
 DEFINE_SUITE("x86 bp modify", bp_modify);
 #endif
@@ -39,12 +37,10 @@ struct test_suite *arch_tests[] = {
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
 	&suite__dwarf_unwind,
 #endif
-#ifdef HAVE_AUXTRACE_SUPPORT
 #ifdef HAVE_EXTRA_TESTS
 	&suite__insn_x86,
 #endif
 	&suite__intel_pt,
-#endif
 #if defined(__x86_64__)
 	&suite__bp_modify,
 #endif
diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build
index 06d7c0205b3d..c0dc5965f362 100644
--- a/tools/perf/arch/x86/util/Build
+++ b/tools/perf/arch/x86/util/Build
@@ -14,7 +14,7 @@ perf-util-y += iostat.o
 perf-util-$(CONFIG_LOCAL_LIBUNWIND)    += unwind-libunwind.o
 perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
 
-perf-util-$(CONFIG_AUXTRACE) += auxtrace.o
+perf-util-y += auxtrace.o
 perf-util-y += archinsn.o
-perf-util-$(CONFIG_AUXTRACE) += intel-pt.o
-perf-util-$(CONFIG_AUXTRACE) += intel-bts.o
+perf-util-y += intel-pt.o
+perf-util-y += intel-bts.o
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c
index 58113482654b..a3f96221758d 100644
--- a/tools/perf/arch/x86/util/pmu.c
+++ b/tools/perf/arch/x86/util/pmu.c
@@ -273,7 +273,6 @@ void perf_pmu__arch_init(struct perf_pmu *pmu)
 {
 	struct perf_pmu_caps *ldlat_cap;
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 	if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) {
 		pmu->auxtrace = true;
 		pmu->selectable = true;
@@ -283,7 +282,6 @@ void perf_pmu__arch_init(struct perf_pmu *pmu)
 		pmu->auxtrace = true;
 		pmu->selectable = true;
 	}
-#endif
 
 	if (x86__is_amd_cpu()) {
 		if (strcmp(pmu->name, "ibs_op"))
diff --git a/tools/perf/builtin-check.c b/tools/perf/builtin-check.c
index 9ce2e71999df..d19769a8f689 100644
--- a/tools/perf/builtin-check.c
+++ b/tools/perf/builtin-check.c
@@ -42,7 +42,6 @@ struct feature_status supported_features[] = {
 	FEATURE_STATUS("dwarf", HAVE_LIBDW_SUPPORT),
 	FEATURE_STATUS("dwarf_getlocations", HAVE_LIBDW_SUPPORT),
 	FEATURE_STATUS("dwarf-unwind", HAVE_DWARF_UNWIND_SUPPORT),
-	FEATURE_STATUS("auxtrace", HAVE_AUXTRACE_SUPPORT),
 	FEATURE_STATUS_TIP("libbfd", HAVE_LIBBFD_SUPPORT, "Deprecated, license incompatibility, use BUILD_NONDISTRO=1 and install binutils-dev[el]"),
 	FEATURE_STATUS("libbpf-strings", HAVE_LIBBPF_STRINGS_SUPPORT),
 	FEATURE_STATUS("libcapstone", HAVE_LIBCAPSTONE_SUPPORT),
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 044074080aa5..bd9245d2dd41 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -239,8 +239,6 @@ static int perf_event__repipe_event_update(const struct perf_tool *tool,
 	return perf_event__repipe_synth(tool, event);
 }
 
-#ifdef HAVE_AUXTRACE_SUPPORT
-
 static int copy_bytes(struct perf_inject *inject, struct perf_data *data, off_t size)
 {
 	char buf[4096];
@@ -297,19 +295,6 @@ static s64 perf_event__repipe_auxtrace(const struct perf_tool *tool,
 	return event->auxtrace.size;
 }
 
-#else
-
-static s64
-perf_event__repipe_auxtrace(const struct perf_tool *tool __maybe_unused,
-			    struct perf_session *session __maybe_unused,
-			    union perf_event *event __maybe_unused)
-{
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-#endif
-
 static int perf_event__repipe(const struct perf_tool *tool,
 			      union perf_event *event,
 			      struct perf_sample *sample __maybe_unused,
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index fe10bb7f35cb..2584d0d8bc82 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -730,8 +730,6 @@ static void record__sig_exit(void)
 	raise(signr);
 }
 
-#ifdef HAVE_AUXTRACE_SUPPORT
-
 static int record__process_auxtrace(const struct perf_tool *tool,
 				    struct mmap *map,
 				    union perf_event *event, void *data1,
@@ -889,40 +887,6 @@ static int record__auxtrace_init(struct record *rec)
 	return auxtrace_parse_filters(rec->evlist);
 }
 
-#else
-
-static inline
-int record__auxtrace_mmap_read(struct record *rec __maybe_unused,
-			       struct mmap *map __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-void record__read_auxtrace_snapshot(struct record *rec __maybe_unused,
-				    bool on_exit __maybe_unused)
-{
-}
-
-static inline
-int auxtrace_record__snapshot_start(struct auxtrace_record *itr __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-int record__auxtrace_snapshot_exit(struct record *rec __maybe_unused)
-{
-	return 0;
-}
-
-static int record__auxtrace_init(struct record *rec __maybe_unused)
-{
-	return 0;
-}
-
-#endif
-
 static int record__config_text_poke(struct evlist *evlist)
 {
 	struct evsel *evsel;
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index d813adbf9889..bd82315bdf8e 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2002,7 +2002,6 @@ static int perf_sample__fprintf_synth_iflag_chg(struct perf_sample *sample, FILE
 	return len + perf_sample__fprintf_pt_spacing(len, fp);
 }
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 static int perf_sample__fprintf_synth_vpadtl(struct perf_sample *data, FILE *fp)
 {
 	struct powerpc_vpadtl_entry *dtl = (struct powerpc_vpadtl_entry *)data->raw_data;
@@ -2021,13 +2020,6 @@ static int perf_sample__fprintf_synth_vpadtl(struct perf_sample *data, FILE *fp)
 
 	return len;
 }
-#else
-static int perf_sample__fprintf_synth_vpadtl(struct perf_sample *data __maybe_unused,
-		FILE *fp __maybe_unused)
-{
-	return 0;
-}
-#endif
 
 static int perf_sample__fprintf_synth(struct perf_sample *sample,
 				      struct evsel *evsel, FILE *fp)
@@ -3649,7 +3641,6 @@ static int process_feature_event(const struct perf_tool *tool __maybe_unused,
 	return 0;
 }
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 static int perf_script__process_auxtrace_info(const struct perf_tool *tool,
 					      struct perf_session *session,
 					      union perf_event *event)
@@ -3664,9 +3655,6 @@ static int perf_script__process_auxtrace_info(const struct perf_tool *tool,
 
 	return ret;
 }
-#else
-#define perf_script__process_auxtrace_info 0
-#endif
 
 static int parse_insn_trace(const struct option *opt __maybe_unused,
 			    const char *str, int unset __maybe_unused)
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index b650ce8864ed..6641701e4828 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -88,7 +88,6 @@ make_no_backtrace   := NO_BACKTRACE=1
 make_no_libcapstone := NO_CAPSTONE=1
 make_no_libnuma     := NO_LIBNUMA=1
 make_no_libbionic   := NO_LIBBIONIC=1
-make_no_auxtrace    := NO_AUXTRACE=1
 make_no_libbpf	    := NO_LIBBPF=1
 make_libbpf_dynamic := LIBBPF_DYNAMIC=1
 make_no_libbpf_DEBUG := NO_LIBBPF=1 DEBUG=1
@@ -121,7 +120,7 @@ make_static         := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX3
 make_minimal        := NO_LIBPYTHON=1 NO_GTK2=1
 make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1
 make_minimal        += NO_LIBNUMA=1 NO_LIBBIONIC=1 NO_LIBDW=1
-make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
+make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_LIBBPF=1
 make_minimal        += NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1
 make_minimal        += NO_LIBCAP=1 NO_CAPSTONE=1
 
@@ -158,7 +157,6 @@ run += make_no_backtrace
 run += make_no_libcapstone
 run += make_no_libnuma
 run += make_no_libbionic
-run += make_no_auxtrace
 run += make_no_libbpf
 run += make_no_libbpf_DEBUG
 run += make_no_libllvm
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 4be313cd115a..1c2a43e1dc68 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -129,22 +129,22 @@ perf-util-y += iostat.o
 perf-util-y += stream.o
 perf-util-y += kvm-stat.o
 perf-util-y += lock-contention.o
-perf-util-$(CONFIG_AUXTRACE) += auxtrace.o
+perf-util-y += auxtrace.o
 perf-util-y += intel-pt-decoder/
-perf-util-$(CONFIG_AUXTRACE) += intel-pt.o
-perf-util-$(CONFIG_AUXTRACE) += intel-bts.o
-perf-util-$(CONFIG_AUXTRACE) += arm-spe.o
-perf-util-$(CONFIG_AUXTRACE) += arm-spe-decoder/
-perf-util-$(CONFIG_AUXTRACE) += hisi-ptt.o
-perf-util-$(CONFIG_AUXTRACE) += hisi-ptt-decoder/
-perf-util-$(CONFIG_AUXTRACE) += s390-cpumsf.o
-perf-util-$(CONFIG_AUXTRACE) += powerpc-vpadtl.o
+perf-util-y += intel-pt.o
+perf-util-y += intel-bts.o
+perf-util-y += arm-spe.o
+perf-util-y += arm-spe-decoder/
+perf-util-y += hisi-ptt.o
+perf-util-y += hisi-ptt-decoder/
+perf-util-y += s390-cpumsf.o
+perf-util-y += powerpc-vpadtl.o
 
 ifdef CONFIG_LIBOPENCSD
-perf-util-$(CONFIG_AUXTRACE) += cs-etm.o
-perf-util-$(CONFIG_AUXTRACE) += cs-etm-decoder/
+perf-util-y += cs-etm.o
+perf-util-y += cs-etm-decoder/
 endif
-perf-util-$(CONFIG_AUXTRACE) += cs-etm-base.o
+perf-util-y += cs-etm-base.o
 
 perf-util-y += parse-branch-options.o
 perf-util-y += dump-insn.o
diff --git a/tools/perf/util/arm-spe-decoder/Build b/tools/perf/util/arm-spe-decoder/Build
index 960062b3cb9e..ab500e0efe24 100644
--- a/tools/perf/util/arm-spe-decoder/Build
+++ b/tools/perf/util/arm-spe-decoder/Build
@@ -1 +1 @@
-perf-util-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o arm-spe-decoder.o
+perf-util-y += arm-spe-pkt-decoder.o arm-spe-decoder.o
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index b320a387464d..59cf72b935ff 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -7,17 +7,12 @@
 #ifndef __PERF_AUXTRACE_H
 #define __PERF_AUXTRACE_H
 
-#include <sys/types.h>
 #include <errno.h>
-#include <stdbool.h>
-#include <stddef.h>
 #include <stdio.h> // FILE
-#include <linux/list.h>
 #include <linux/perf_event.h>
 #include <linux/types.h>
-#include <perf/cpumap.h>
-#include <asm/bitsperlong.h>
 #include <asm/barrier.h>
+#include <perf/cpumap.h>
 
 union perf_event;
 struct perf_session;
@@ -459,8 +454,6 @@ struct addr_filters {
 
 struct auxtrace_cache;
 
-#ifdef HAVE_AUXTRACE_SUPPORT
-
 u64 compat_auxtrace_mmap__read_head(struct auxtrace_mmap *mm);
 int compat_auxtrace_mmap__write_tail(struct auxtrace_mmap *mm, u64 tail);
 
@@ -706,215 +699,4 @@ void itrace_synth_opts__clear_time_range(struct itrace_synth_opts *opts)
 	opts->range_num = 0;
 }
 
-#else
-#include "debug.h"
-
-static inline struct auxtrace_record *
-auxtrace_record__init(struct evlist *evlist __maybe_unused,
-		      int *err)
-{
-	*err = 0;
-	return NULL;
-}
-
-static inline
-void auxtrace_record__free(struct auxtrace_record *itr __maybe_unused)
-{
-}
-
-static inline
-int auxtrace_record__options(struct auxtrace_record *itr __maybe_unused,
-			     struct evlist *evlist __maybe_unused,
-			     struct record_opts *opts __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-int perf_event__process_auxtrace_info(const struct perf_tool *tool __maybe_unused,
-				      struct perf_session *session __maybe_unused,
-				      union perf_event *event __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-s64 perf_event__process_auxtrace(const struct perf_tool *tool __maybe_unused,
-				 struct perf_session *session __maybe_unused,
-				 union perf_event *event __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-int perf_event__process_auxtrace_error(const struct perf_tool *tool __maybe_unused,
-				       struct perf_session *session __maybe_unused,
-				       union perf_event *event __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-void perf_session__auxtrace_error_inc(struct perf_session *session
-				      __maybe_unused,
-				      union perf_event *event
-				      __maybe_unused)
-{
-}
-
-static inline
-void events_stats__auxtrace_error_warn(const struct events_stats *stats
-				       __maybe_unused)
-{
-}
-
-static inline
-int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts __maybe_unused,
-			       const char *str __maybe_unused, int unset __maybe_unused)
-{
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-static inline
-int itrace_parse_synth_opts(const struct option *opt __maybe_unused,
-			    const char *str __maybe_unused,
-			    int unset __maybe_unused)
-{
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-static inline
-int auxtrace_parse_snapshot_options(struct auxtrace_record *itr __maybe_unused,
-				    struct record_opts *opts __maybe_unused,
-				    const char *str)
-{
-	if (!str)
-		return 0;
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-static inline
-int auxtrace_parse_sample_options(struct auxtrace_record *itr __maybe_unused,
-				  struct evlist *evlist __maybe_unused,
-				  struct record_opts *opts __maybe_unused,
-				  const char *str)
-{
-	if (!str)
-		return 0;
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-static inline
-int auxtrace_parse_aux_action(struct evlist *evlist __maybe_unused)
-{
-	pr_err("AUX area tracing not supported\n");
-	return -EINVAL;
-}
-
-static inline
-int auxtrace__process_event(struct perf_session *session __maybe_unused,
-			    union perf_event *event __maybe_unused,
-			    struct perf_sample *sample __maybe_unused,
-			    const struct perf_tool *tool __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-void auxtrace__dump_auxtrace_sample(struct perf_session *session __maybe_unused,
-				    struct perf_sample *sample __maybe_unused)
-{
-}
-
-static inline
-int auxtrace__flush_events(struct perf_session *session __maybe_unused,
-			   const struct perf_tool *tool __maybe_unused)
-{
-	return 0;
-}
-
-static inline
-void auxtrace__free_events(struct perf_session *session __maybe_unused)
-{
-}
-
-static inline
-void auxtrace_cache__free(struct auxtrace_cache *auxtrace_cache __maybe_unused)
-{
-}
-
-static inline
-void auxtrace__free(struct perf_session *session __maybe_unused)
-{
-}
-
-static inline
-int auxtrace_index__write(int fd __maybe_unused,
-			  struct list_head *head __maybe_unused)
-{
-	return -EINVAL;
-}
-
-static inline
-int auxtrace_index__process(int fd __maybe_unused,
-			    u64 size __maybe_unused,
-			    struct perf_session *session __maybe_unused,
-			    bool needs_swap __maybe_unused)
-{
-	return -EINVAL;
-}
-
-static inline
-void auxtrace_index__free(struct list_head *head __maybe_unused)
-{
-}
-
-static inline
-bool auxtrace__evsel_is_auxtrace(struct perf_session *session __maybe_unused,
-				 struct evsel *evsel __maybe_unused)
-{
-	return false;
-}
-
-static inline
-int auxtrace_parse_filters(struct evlist *evlist __maybe_unused)
-{
-	return 0;
-}
-
-int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
-			struct auxtrace_mmap_params *mp,
-			void *userpg, int fd);
-void auxtrace_mmap__munmap(struct auxtrace_mmap *mm);
-void auxtrace_mmap_params__init(struct auxtrace_mmap_params *mp,
-				off_t auxtrace_offset,
-				unsigned int auxtrace_pages,
-				bool auxtrace_overwrite);
-void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
-				   struct evlist *evlist,
-				   struct evsel *evsel, int idx);
-
-#define ITRACE_HELP ""
-
-static inline
-void itrace_synth_opts__set_time_range(struct itrace_synth_opts *opts
-				       __maybe_unused,
-				       struct perf_time_interval *ptime_range
-				       __maybe_unused,
-				       int range_num __maybe_unused)
-{
-}
-
-static inline
-void itrace_synth_opts__clear_time_range(struct itrace_synth_opts *opts
-					 __maybe_unused)
-{
-}
-
-#endif
-
 #endif
diff --git a/tools/perf/util/cs-etm-decoder/Build b/tools/perf/util/cs-etm-decoder/Build
index 056d665f7f88..27550db2aa4c 100644
--- a/tools/perf/util/cs-etm-decoder/Build
+++ b/tools/perf/util/cs-etm-decoder/Build
@@ -1 +1 @@
-perf-util-$(CONFIG_AUXTRACE) += cs-etm-decoder.o
+perf-util-y += cs-etm-decoder.o
diff --git a/tools/perf/util/hisi-ptt-decoder/Build b/tools/perf/util/hisi-ptt-decoder/Build
index 3298f7b7e308..2ee0eb731656 100644
--- a/tools/perf/util/hisi-ptt-decoder/Build
+++ b/tools/perf/util/hisi-ptt-decoder/Build
@@ -1 +1 @@
-perf-util-$(CONFIG_AUXTRACE) += hisi-ptt-pkt-decoder.o
+perf-util-y += hisi-ptt-pkt-decoder.o
diff --git a/tools/perf/util/intel-pt-decoder/Build b/tools/perf/util/intel-pt-decoder/Build
index 5b8f0149167d..8fd7e4330044 100644
--- a/tools/perf/util/intel-pt-decoder/Build
+++ b/tools/perf/util/intel-pt-decoder/Build
@@ -1,4 +1,4 @@
-perf-util-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o
+perf-util-y += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o
 
 inat_tables_script = $(srctree)/tools/arch/x86/tools/gen-insn-attr-x86.awk
 inat_tables_maps = $(srctree)/tools/arch/x86/lib/x86-opcode-map.txt
@@ -7,11 +7,7 @@ $(OUTPUT)util/intel-pt-decoder/inat-tables.c: $(inat_tables_script) $(inat_table
 	$(call rule_mkdir)
 	@$(call echo-cmd,gen)$(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@ || rm -f $@
 
-ifeq ($(SRCARCH),x86)
-  perf-util-y += inat.o insn.o
-else
-  perf-util-$(CONFIG_AUXTRACE) += inat.o insn.o
-endif
+perf-util-y += inat.o insn.o
 
 $(OUTPUT)util/intel-pt-decoder/inat.o: $(srctree)/tools/arch/x86/lib/inat.c $(OUTPUT)util/intel-pt-decoder/inat-tables.c
 	$(call rule_mkdir)
diff --git a/tools/perf/util/synthetic-events.h b/tools/perf/util/synthetic-events.h
index ee29615d68e5..f8588b6cf11a 100644
--- a/tools/perf/util/synthetic-events.h
+++ b/tools/perf/util/synthetic-events.h
@@ -107,24 +107,9 @@ int machine__synthesize_threads(struct machine *machine, struct target *target,
 				struct perf_thread_map *threads, bool needs_mmap, bool data_mmap,
 				unsigned int nr_threads_synthesize);
 
-#ifdef HAVE_AUXTRACE_SUPPORT
 int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr, const struct perf_tool *tool,
 					 struct perf_session *session, perf_event__handler_t process);
 
-#else // HAVE_AUXTRACE_SUPPORT
-
-#include <errno.h>
-
-static inline int
-perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr __maybe_unused,
-				     const struct perf_tool *tool __maybe_unused,
-				     struct perf_session *session __maybe_unused,
-				     perf_event__handler_t process __maybe_unused)
-{
-	return -EINVAL;
-}
-#endif // HAVE_AUXTRACE_SUPPORT
-
 #ifdef HAVE_LIBBPF_SUPPORT
 int perf_event__synthesize_bpf_events(struct perf_session *session, perf_event__handler_t process,
 				      struct machine *machine, struct record_opts *opts);
-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v1 5/5] perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
                   ` (3 preceding siblings ...)
  2025-11-10  1:31 ` [PATCH v1 4/5] perf build: Remove NO_AUXTRACE build option Ian Rogers
@ 2025-11-10  1:31 ` Ian Rogers
  2025-11-11  6:21 ` [PATCH v1 0/5] Remove NO_AUXTRACE build option Namhyung Kim
  5 siblings, 0 replies; 9+ messages in thread
From: Ian Rogers @ 2025-11-10  1:31 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, John Garry, Will Deacon, James Clark, Mike Leach,
	Leo Yan, Suzuki K Poulose, Yicong Yang, Jonathan Cameron,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso, André Almeida,
	Tomas Glozar, Quentin Monnet, Yuzhuo Jing, Blake Jones,
	Charlie Jenkins, Yeoreum Yun, Athira Rajeev, Ravi Bangoria,
	Collin Funk, Dapeng Mi, Thomas Richter, Dmitry Vyukov, Andi Kleen,
	Howard Chu, Zecheng Li, tanze, Gabriele Monaco, GuoHan Zhao,
	Markus Elfring, Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

errno.h isn't used in auxtrace.h so remove it and fix build failures
caused by transitive dependencies through auxtrace.h on errno.h.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/arch/arm/annotate/instructions.c   | 1 +
 tools/perf/arch/arm/util/auxtrace.c           | 1 +
 tools/perf/arch/arm64/annotate/instructions.c | 1 +
 tools/perf/arch/arm64/util/arm-spe.c          | 1 +
 tools/perf/arch/arm64/util/hisi-ptt.c         | 1 +
 tools/perf/arch/powerpc/util/auxtrace.c       | 2 +-
 tools/perf/arch/s390/util/auxtrace.c          | 1 +
 tools/perf/arch/x86/tests/topdown.c           | 1 +
 tools/perf/arch/x86/util/topdown.c            | 1 +
 tools/perf/bench/evlist-open-close.c          | 1 +
 tools/perf/bench/futex.c                      | 1 +
 tools/perf/bench/pmu-scan.c                   | 1 +
 tools/perf/bench/synthesize.c                 | 1 +
 tools/perf/builtin-mem.c                      | 1 +
 tools/perf/tests/hwmon_pmu.c                  | 1 +
 tools/perf/tests/parse-metric.c               | 1 +
 tools/perf/tests/pfm.c                        | 1 +
 tools/perf/ui/hist.c                          | 1 +
 tools/perf/util/annotate-data.c               | 2 +-
 tools/perf/util/auxtrace.h                    | 1 -
 tools/perf/util/bpf-filter.h                  | 2 ++
 tools/perf/util/bpf-trace-summary.c           | 1 +
 tools/perf/util/bpf_counter_cgroup.c          | 1 +
 tools/perf/util/bpf_ftrace.c                  | 3 ++-
 tools/perf/util/bpf_map.c                     | 1 +
 tools/perf/util/cgroup.c                      | 1 +
 tools/perf/util/drm_pmu.c                     | 1 +
 tools/perf/util/evswitch.c                    | 1 +
 tools/perf/util/intel-tpebs.c                 | 1 +
 tools/perf/util/kvm-stat.h                    | 1 +
 tools/perf/util/mmap.c                        | 1 +
 tools/perf/util/pfm.c                         | 1 +
 tools/perf/util/powerpc-vpadtl.c              | 1 +
 tools/perf/util/stat-shadow.c                 | 1 +
 34 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/tools/perf/arch/arm/annotate/instructions.c b/tools/perf/arch/arm/annotate/instructions.c
index cf91a43362b0..5e667b0f5512 100644
--- a/tools/perf/arch/arm/annotate/instructions.c
+++ b/tools/perf/arch/arm/annotate/instructions.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/compiler.h>
 #include <linux/zalloc.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <regex.h>
 #include <stdlib.h>
diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
index 3b8eca0ffb17..eb6404267f17 100644
--- a/tools/perf/arch/arm/util/auxtrace.c
+++ b/tools/perf/arch/arm/util/auxtrace.c
@@ -5,6 +5,7 @@
  */
 
 #include <dirent.h>
+#include <errno.h>
 #include <stdbool.h>
 #include <linux/coresight-pmu.h>
 #include <linux/zalloc.h>
diff --git a/tools/perf/arch/arm64/annotate/instructions.c b/tools/perf/arch/arm64/annotate/instructions.c
index d465d093e7eb..16cb62d40bd9 100644
--- a/tools/perf/arch/arm64/annotate/instructions.c
+++ b/tools/perf/arch/arm64/annotate/instructions.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/compiler.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <regex.h>
 #include <stdlib.h>
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index cac43cde7dbe..d5ec1408d0ae 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -10,6 +10,7 @@
 #include <linux/log2.h>
 #include <linux/string.h>
 #include <linux/zalloc.h>
+#include <errno.h>
 #include <time.h>
 
 #include "../../../util/cpumap.h"
diff --git a/tools/perf/arch/arm64/util/hisi-ptt.c b/tools/perf/arch/arm64/util/hisi-ptt.c
index eac9739c87e6..fe457fd58c9e 100644
--- a/tools/perf/arch/arm64/util/hisi-ptt.c
+++ b/tools/perf/arch/arm64/util/hisi-ptt.c
@@ -9,6 +9,7 @@
 #include <linux/bitops.h>
 #include <linux/log2.h>
 #include <linux/zalloc.h>
+#include <errno.h>
 #include <time.h>
 
 #include <internal/lib.h> // page_size
diff --git a/tools/perf/arch/powerpc/util/auxtrace.c b/tools/perf/arch/powerpc/util/auxtrace.c
index 62c6f67f1bbe..292ea335e4ff 100644
--- a/tools/perf/arch/powerpc/util/auxtrace.c
+++ b/tools/perf/arch/powerpc/util/auxtrace.c
@@ -2,7 +2,7 @@
 /*
  * VPA support
  */
-
+#include <errno.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/string.h>
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c
index 5068baa3e092..1a3676145066 100644
--- a/tools/perf/arch/s390/util/auxtrace.c
+++ b/tools/perf/arch/s390/util/auxtrace.c
@@ -1,3 +1,4 @@
+#include <errno.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <linux/kernel.h>
diff --git a/tools/perf/arch/x86/tests/topdown.c b/tools/perf/arch/x86/tests/topdown.c
index 1eba3b4594ef..3ee4e5e71be3 100644
--- a/tools/perf/arch/x86/tests/topdown.c
+++ b/tools/perf/arch/x86/tests/topdown.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include "arch-tests.h"
 #include "../util/topdown.h"
 #include "debug.h"
diff --git a/tools/perf/arch/x86/util/topdown.c b/tools/perf/arch/x86/util/topdown.c
index 0d01b662627a..bafd285119d7 100644
--- a/tools/perf/arch/x86/util/topdown.c
+++ b/tools/perf/arch/x86/util/topdown.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include "util/evlist.h"
 #include "util/pmu.h"
 #include "util/pmus.h"
diff --git a/tools/perf/bench/evlist-open-close.c b/tools/perf/bench/evlist-open-close.c
index bfaf50e4e519..faf9c34b4a5d 100644
--- a/tools/perf/bench/evlist-open-close.c
+++ b/tools/perf/bench/evlist-open-close.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tools/perf/bench/futex.c b/tools/perf/bench/futex.c
index 1481196a22f0..1968c9d00b5b 100644
--- a/tools/perf/bench/futex.c
+++ b/tools/perf/bench/futex.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/prctl.h>
diff --git a/tools/perf/bench/pmu-scan.c b/tools/perf/bench/pmu-scan.c
index 9e4d36486f62..14a464ad8cea 100644
--- a/tools/perf/bench/pmu-scan.c
+++ b/tools/perf/bench/pmu-scan.c
@@ -4,6 +4,7 @@
  *
  * Copyright 2023 Google LLC.
  */
+#include <errno.h>
 #include <stdio.h>
 #include "bench.h"
 #include "util/debug.h"
diff --git a/tools/perf/bench/synthesize.c b/tools/perf/bench/synthesize.c
index b3d493697675..265d49a913d9 100644
--- a/tools/perf/bench/synthesize.c
+++ b/tools/perf/bench/synthesize.c
@@ -6,6 +6,7 @@
  *
  * Copyright 2019 Google LLC.
  */
+#include <errno.h>
 #include <stdio.h>
 #include "bench.h"
 #include "../util/debug.h"
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index c6496adff3fe..d43500b92a7b 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c
index 151f02701c8c..4aa4aac94f09 100644
--- a/tools/perf/tests/hwmon_pmu.c
+++ b/tools/perf/tests/hwmon_pmu.c
@@ -4,6 +4,7 @@
 #include "hwmon_pmu.h"
 #include "parse-events.h"
 #include "tests.h"
+#include <errno.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <linux/compiler.h>
diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c
index 66a5275917e2..9b1df1eb455a 100644
--- a/tools/perf/tests/parse-metric.c
+++ b/tools/perf/tests/parse-metric.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/compiler.h>
+#include <errno.h>
 #include <string.h>
 #include <perf/cpumap.h>
 #include <perf/evlist.h>
diff --git a/tools/perf/tests/pfm.c b/tools/perf/tests/pfm.c
index 2e38dfa34b6c..fca4a86452df 100644
--- a/tools/perf/tests/pfm.c
+++ b/tools/perf/tests/pfm.c
@@ -4,6 +4,7 @@
  *
  * Copyright 2020 Google LLC.
  */
+#include <errno.h>
 #include "tests.h"
 #include "util/debug.h"
 #include "util/evlist.h"
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index b085eb0de849..e58327595d37 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include <inttypes.h>
 #include <math.h>
 #include <stdlib.h>
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index e183c6104d59..07cf9c334be0 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -4,7 +4,7 @@
  *
  * Written by Namhyung Kim <namhyung@kernel.org>
  */
-
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes.h>
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index 59cf72b935ff..eee2c11f7666 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -7,7 +7,6 @@
 #ifndef __PERF_AUXTRACE_H
 #define __PERF_AUXTRACE_H
 
-#include <errno.h>
 #include <stdio.h> // FILE
 #include <linux/perf_event.h>
 #include <linux/types.h>
diff --git a/tools/perf/util/bpf-filter.h b/tools/perf/util/bpf-filter.h
index 122477f2de44..818c554b91b2 100644
--- a/tools/perf/util/bpf-filter.h
+++ b/tools/perf/util/bpf-filter.h
@@ -36,6 +36,8 @@ int perf_bpf_filter__unpin(void);
 
 #else /* !HAVE_BPF_SKEL */
 
+#include <errno.h>
+
 static inline int perf_bpf_filter__parse(struct list_head *expr_head __maybe_unused,
 					 const char *str __maybe_unused)
 {
diff --git a/tools/perf/util/bpf-trace-summary.c b/tools/perf/util/bpf-trace-summary.c
index 8dfe7e678941..cf6e1e4402d5 100644
--- a/tools/perf/util/bpf-trace-summary.c
+++ b/tools/perf/util/bpf-trace-summary.c
@@ -1,4 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
+#include <errno.h>
 #include <inttypes.h>
 #include <math.h>
 #include <stdio.h>
diff --git a/tools/perf/util/bpf_counter_cgroup.c b/tools/perf/util/bpf_counter_cgroup.c
index 68bd994c8880..17d7196c6589 100644
--- a/tools/perf/util/bpf_counter_cgroup.c
+++ b/tools/perf/util/bpf_counter_cgroup.c
@@ -4,6 +4,7 @@
 /* Copyright (c) 2021 Google */
 
 #include <assert.h>
+#include <errno.h>
 #include <limits.h>
 #include <unistd.h>
 #include <sys/file.h>
diff --git a/tools/perf/util/bpf_ftrace.c b/tools/perf/util/bpf_ftrace.c
index e61a3b20be0a..c456d24efa30 100644
--- a/tools/perf/util/bpf_ftrace.c
+++ b/tools/perf/util/bpf_ftrace.c
@@ -1,6 +1,7 @@
-#include <stdio.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include <bpf/bpf.h>
diff --git a/tools/perf/util/bpf_map.c b/tools/perf/util/bpf_map.c
index 578f27d2d6b4..442f91b4e8e1 100644
--- a/tools/perf/util/bpf_map.c
+++ b/tools/perf/util/bpf_map.c
@@ -5,6 +5,7 @@
 #include <bpf/libbpf.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
+#include <errno.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 25e2769b5e74..040eb75f0804 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -10,6 +10,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/tools/perf/util/drm_pmu.c b/tools/perf/util/drm_pmu.c
index 98d4d2b556d4..b3052266d599 100644
--- a/tools/perf/util/drm_pmu.c
+++ b/tools/perf/util/drm_pmu.c
@@ -10,6 +10,7 @@
 #include <api/io.h>
 #include <ctype.h>
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <linux/unistd.h>
diff --git a/tools/perf/util/evswitch.c b/tools/perf/util/evswitch.c
index 40cb56a9347d..d4c06a3f825a 100644
--- a/tools/perf/util/evswitch.c
+++ b/tools/perf/util/evswitch.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
 
+#include <errno.h>
 #include "evswitch.h"
 #include "evlist.h"
 
diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c
index 21359155f2a0..3c958d738ca6 100644
--- a/tools/perf/util/intel-tpebs.c
+++ b/tools/perf/util/intel-tpebs.c
@@ -25,6 +25,7 @@
 #include "stat.h"
 #include <sys/stat.h>
 #include <sys/file.h>
+#include <errno.h>
 #include <poll.h>
 #include <math.h>
 
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index 53db3d56108b..a356b839c2ee 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -10,6 +10,7 @@
 #include "symbol.h"
 #include "record.h"
 
+#include <errno.h>
 #include <stdlib.h>
 #include <linux/zalloc.h>
 
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index a34726219af3..b69f926d314b 100644
--- a/tools/perf/util/mmap.c
+++ b/tools/perf/util/mmap.c
@@ -7,6 +7,7 @@
  */
 
 #include <sys/mman.h>
+#include <errno.h>
 #include <inttypes.h>
 #include <asm/bug.h>
 #include <linux/zalloc.h>
diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
index e5b3a2a5ddef..d9043f4afbe7 100644
--- a/tools/perf/util/pfm.c
+++ b/tools/perf/util/pfm.c
@@ -15,6 +15,7 @@
 #include "util/strbuf.h"
 #include "util/thread_map.h"
 
+#include <errno.h>
 #include <string.h>
 #include <linux/kernel.h>
 #include <perfmon/pfmlib_perf_event.h>
diff --git a/tools/perf/util/powerpc-vpadtl.c b/tools/perf/util/powerpc-vpadtl.c
index bfa4156d7a97..d1c3396f182f 100644
--- a/tools/perf/util/powerpc-vpadtl.c
+++ b/tools/perf/util/powerpc-vpadtl.c
@@ -4,6 +4,7 @@
  */
 
 #include <linux/string.h>
+#include <errno.h>
 #include <inttypes.h>
 #include "color.h"
 #include "evlist.h"
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index abaf6b579bfc..0002e51194c2 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <errno.h>
 #include <math.h>
 #include <stdio.h>
 #include "evsel.h"
-- 
2.51.2.1041.gc1ab5b90ca-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
  2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
                   ` (4 preceding siblings ...)
  2025-11-10  1:31 ` [PATCH v1 5/5] perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies Ian Rogers
@ 2025-11-11  6:21 ` Namhyung Kim
  2025-11-11 18:01   ` Ian Rogers
  5 siblings, 1 reply; 9+ messages in thread
From: Namhyung Kim @ 2025-11-11  6:21 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, John Garry,
	Will Deacon, James Clark, Mike Leach, Leo Yan, Suzuki K Poulose,
	Yicong Yang, Jonathan Cameron, Thomas Gleixner, Darren Hart,
	Davidlohr Bueso, André Almeida, Tomas Glozar, Quentin Monnet,
	Yuzhuo Jing, Blake Jones, Charlie Jenkins, Yeoreum Yun,
	Athira Rajeev, Ravi Bangoria, Collin Funk, Dapeng Mi,
	Thomas Richter, Dmitry Vyukov, Andi Kleen, Howard Chu, Zecheng Li,
	tanze, Gabriele Monaco, GuoHan Zhao, Markus Elfring,
	Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

Hi Ian,

On Sun, Nov 09, 2025 at 05:31:47PM -0800, Ian Rogers wrote:
> Switch the __get_cpuid feature for intel-pt to use the provided cpuid
> function in perf, this removes the need for NO_AUXTRACE when the
> feature detection fails. Remove the now unnecessary feature
> detection. Remove NO_AUXTRACE as it just builds a more broken version

Can you please elaborate what the broken part is?

Thanks,
Namhyung


> of perf and isn't guarding dependencies on any libraries, etc. Clean
> up headers files for auxtrace.h.
> 
> This was prompted by needing to make a v2 patch set of:
> https://lore.kernel.org/lkml/20251107170712.2302714-1-irogers@google.com/
> due to a broken NO_AUXTRACE configuration.
> 
> Ian Rogers (5):
>   perf intel-pt: Use the perf provided "cpuid.h"
>   perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid
>   tool build: Remove __get_cpuid feature test
>   perf build: Remove NO_AUXTRACE build option
>   perf auxtrace: Remove errno.h from auxtrace.h and fix transitive
>     dependencies
> 
>  tools/build/Makefile.feature                  |   2 -
>  tools/build/feature/Makefile                  |   4 -
>  tools/build/feature/test-all.c                |   5 -
>  tools/build/feature/test-get_cpuid.c          |   8 -
>  tools/perf/Documentation/perf-check.txt       |   1 -
>  tools/perf/Makefile.config                    |  13 --
>  tools/perf/Makefile.perf                      |   2 -
>  tools/perf/arch/arm/annotate/instructions.c   |   1 +
>  tools/perf/arch/arm/util/Build                |   2 +-
>  tools/perf/arch/arm/util/auxtrace.c           |   1 +
>  tools/perf/arch/arm/util/pmu.c                |   2 -
>  tools/perf/arch/arm64/annotate/instructions.c |   1 +
>  tools/perf/arch/arm64/util/Build              |  19 +-
>  tools/perf/arch/arm64/util/arm-spe.c          |   1 +
>  tools/perf/arch/arm64/util/hisi-ptt.c         |   1 +
>  tools/perf/arch/powerpc/util/Build            |   2 +-
>  tools/perf/arch/powerpc/util/auxtrace.c       |   2 +-
>  tools/perf/arch/s390/util/Build               |   2 +-
>  tools/perf/arch/s390/util/auxtrace.c          |   1 +
>  tools/perf/arch/x86/tests/Build               |   4 +-
>  tools/perf/arch/x86/tests/arch-tests.c        |   4 -
>  tools/perf/arch/x86/tests/intel-pt-test.c     |   6 +-
>  tools/perf/arch/x86/tests/topdown.c           |   1 +
>  tools/perf/arch/x86/util/Build                |   6 +-
>  tools/perf/arch/x86/util/intel-pt.c           |   4 +-
>  tools/perf/arch/x86/util/pmu.c                |   2 -
>  tools/perf/arch/x86/util/topdown.c            |   1 +
>  tools/perf/bench/evlist-open-close.c          |   1 +
>  tools/perf/bench/futex.c                      |   1 +
>  tools/perf/bench/pmu-scan.c                   |   1 +
>  tools/perf/bench/synthesize.c                 |   1 +
>  tools/perf/builtin-check.c                    |   1 -
>  tools/perf/builtin-inject.c                   |  15 --
>  tools/perf/builtin-mem.c                      |   1 +
>  tools/perf/builtin-record.c                   |  36 ---
>  tools/perf/builtin-script.c                   |  12 -
>  tools/perf/tests/hwmon_pmu.c                  |   1 +
>  tools/perf/tests/make                         |   4 +-
>  tools/perf/tests/parse-metric.c               |   1 +
>  tools/perf/tests/pfm.c                        |   1 +
>  tools/perf/ui/hist.c                          |   1 +
>  tools/perf/util/Build                         |  24 +-
>  tools/perf/util/annotate-data.c               |   2 +-
>  tools/perf/util/arm-spe-decoder/Build         |   2 +-
>  tools/perf/util/auxtrace.h                    | 221 +-----------------
>  tools/perf/util/bpf-filter.h                  |   2 +
>  tools/perf/util/bpf-trace-summary.c           |   1 +
>  tools/perf/util/bpf_counter_cgroup.c          |   1 +
>  tools/perf/util/bpf_ftrace.c                  |   3 +-
>  tools/perf/util/bpf_map.c                     |   1 +
>  tools/perf/util/cgroup.c                      |   1 +
>  tools/perf/util/cs-etm-decoder/Build          |   2 +-
>  tools/perf/util/drm_pmu.c                     |   1 +
>  tools/perf/util/evswitch.c                    |   1 +
>  tools/perf/util/hisi-ptt-decoder/Build        |   2 +-
>  tools/perf/util/intel-pt-decoder/Build        |   8 +-
>  tools/perf/util/intel-tpebs.c                 |   1 +
>  tools/perf/util/kvm-stat.h                    |   1 +
>  tools/perf/util/mmap.c                        |   1 +
>  tools/perf/util/pfm.c                         |   1 +
>  tools/perf/util/powerpc-vpadtl.c              |   1 +
>  tools/perf/util/stat-shadow.c                 |   1 +
>  tools/perf/util/synthetic-events.h            |  15 --
>  63 files changed, 77 insertions(+), 391 deletions(-)
>  delete mode 100644 tools/build/feature/test-get_cpuid.c
> 
> -- 
> 2.51.2.1041.gc1ab5b90ca-goog
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
  2025-11-11  6:21 ` [PATCH v1 0/5] Remove NO_AUXTRACE build option Namhyung Kim
@ 2025-11-11 18:01   ` Ian Rogers
  2025-11-12  9:21     ` James Clark
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Rogers @ 2025-11-11 18:01 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, John Garry,
	Will Deacon, James Clark, Mike Leach, Leo Yan, Suzuki K Poulose,
	Yicong Yang, Jonathan Cameron, Thomas Gleixner, Darren Hart,
	Davidlohr Bueso, André Almeida, Tomas Glozar, Quentin Monnet,
	Yuzhuo Jing, Blake Jones, Charlie Jenkins, Yeoreum Yun,
	Athira Rajeev, Ravi Bangoria, Collin Funk, Dapeng Mi,
	Thomas Richter, Dmitry Vyukov, Andi Kleen, Howard Chu, Zecheng Li,
	tanze, Gabriele Monaco, GuoHan Zhao, Markus Elfring,
	Colin Ian King, Kan Liang, Dr. David Alan Gilbert,
	Jean-Philippe Romain, Yang Li, linux-kernel, linux-perf-users

On Mon, Nov 10, 2025 at 10:21 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hi Ian,
>
> On Sun, Nov 09, 2025 at 05:31:47PM -0800, Ian Rogers wrote:
> > Switch the __get_cpuid feature for intel-pt to use the provided cpuid
> > function in perf, this removes the need for NO_AUXTRACE when the
> > feature detection fails. Remove the now unnecessary feature
> > detection. Remove NO_AUXTRACE as it just builds a more broken version
>
> Can you please elaborate what the broken part is?

Sure. I'll summarize what alters in patch 4. NO_AUXTRACE is
controlling 3 main things:
 * set up of aux options for PMUs (code in the arch directory)
   * ARM: coresight and SPE
   * Intel: BTS and PT
   * PowerPC: VPA DTL
   * S390: cpumsf
 * support for decoding aux events (common code that can be
cross-compiled assuming other library dependencies are available)
   * ARM: coresight
   * HiSi: PTT decoder
   * Intel: BTS and PT
   * PowerPC: VPA DTL
   * S390: cpumsf
 * Tool support for aux buffers (common shared builtin code):
  * perf record: aux options for events, snapshot, aux-sample
  * perf inject: aux events will fail the entire perf inject command

So somebody with a NO_AUXTRACE build would generally experience a very
sad perf command. Having the option made sense when there were feature
tests that could fail, but possibly that should have just controlled
not compiling intel-pt. Having the option is extra burden on
developers/maintainers, as shown in my comment:

> This was prompted by needing to make a v2 patch set of:
> https://lore.kernel.org/lkml/20251107170712.2302714-1-irogers@google.com/
> due to a broken NO_AUXTRACE configuration.

Somebody may have been using NO_AUXTRACE as a proxy for not having
some library, but I don't see that in the code. If this is the case we
should add the appropriate feature test, ..
Not having NO_AUXTRACE may have been a bug work around for someone, in
which case we should work to fix the bug. Again, I don't know of this
case and don't see it in the code.

Thanks,
Ian

> Thanks,
> Namhyung

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
  2025-11-11 18:01   ` Ian Rogers
@ 2025-11-12  9:21     ` James Clark
  0 siblings, 0 replies; 9+ messages in thread
From: James Clark @ 2025-11-12  9:21 UTC (permalink / raw)
  To: Ian Rogers, Namhyung Kim
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, John Garry,
	Will Deacon, Mike Leach, Leo Yan, Suzuki K Poulose, Yicong Yang,
	Jonathan Cameron, Thomas Gleixner, Darren Hart, Davidlohr Bueso,
	André Almeida, Tomas Glozar, Quentin Monnet, Yuzhuo Jing,
	Blake Jones, Charlie Jenkins, Yeoreum Yun, Athira Rajeev,
	Ravi Bangoria, Collin Funk, Dapeng Mi, Thomas Richter,
	Dmitry Vyukov, Andi Kleen, Howard Chu, Zecheng Li, tanze,
	Gabriele Monaco, GuoHan Zhao, Markus Elfring, Colin Ian King,
	Kan Liang, Dr. David Alan Gilbert, Jean-Philippe Romain, Yang Li,
	linux-kernel, linux-perf-users



On 11/11/2025 6:01 pm, Ian Rogers wrote:
> On Mon, Nov 10, 2025 at 10:21 PM Namhyung Kim <namhyung@kernel.org> wrote:
>>
>> Hi Ian,
>>
>> On Sun, Nov 09, 2025 at 05:31:47PM -0800, Ian Rogers wrote:
>>> Switch the __get_cpuid feature for intel-pt to use the provided cpuid
>>> function in perf, this removes the need for NO_AUXTRACE when the
>>> feature detection fails. Remove the now unnecessary feature
>>> detection. Remove NO_AUXTRACE as it just builds a more broken version
>>
>> Can you please elaborate what the broken part is?
> 
> Sure. I'll summarize what alters in patch 4. NO_AUXTRACE is
> controlling 3 main things:
>   * set up of aux options for PMUs (code in the arch directory)
>     * ARM: coresight and SPE
>     * Intel: BTS and PT
>     * PowerPC: VPA DTL
>     * S390: cpumsf
>   * support for decoding aux events (common code that can be
> cross-compiled assuming other library dependencies are available)
>     * ARM: coresight
>     * HiSi: PTT decoder
>     * Intel: BTS and PT
>     * PowerPC: VPA DTL
>     * S390: cpumsf
>   * Tool support for aux buffers (common shared builtin code):
>    * perf record: aux options for events, snapshot, aux-sample
>    * perf inject: aux events will fail the entire perf inject command
> 
> So somebody with a NO_AUXTRACE build would generally experience a very
> sad perf command. Having the option made sense when there were feature
> tests that could fail, but possibly that should have just controlled
> not compiling intel-pt. Having the option is extra burden on
> developers/maintainers, as shown in my comment:
> 
>> This was prompted by needing to make a v2 patch set of:
>> https://lore.kernel.org/lkml/20251107170712.2302714-1-irogers@google.com/
>> due to a broken NO_AUXTRACE configuration.
> 
> Somebody may have been using NO_AUXTRACE as a proxy for not having
> some library, but I don't see that in the code. If this is the case we
> should add the appropriate feature test, ..
> Not having NO_AUXTRACE may have been a bug work around for someone, in
> which case we should work to fix the bug. Again, I don't know of this
> case and don't see it in the code.
> 
> Thanks,
> Ian
> 
>> Thanks,
>> Namhyung

Seems like a nice simplification even if nothing was badly broken.

Reviewed-by: James Clark <james.clark@linaro.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-11-12  9:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10  1:31 [PATCH v1 0/5] Remove NO_AUXTRACE build option Ian Rogers
2025-11-10  1:31 ` [PATCH v1 1/5] perf intel-pt: Use the perf provided "cpuid.h" Ian Rogers
2025-11-10  1:31 ` [PATCH v1 2/5] perf build: Don't add NO_AUXTRACE if missing feature-get_cpuid Ian Rogers
2025-11-10  1:31 ` [PATCH v1 3/5] tool build: Remove __get_cpuid feature test Ian Rogers
2025-11-10  1:31 ` [PATCH v1 4/5] perf build: Remove NO_AUXTRACE build option Ian Rogers
2025-11-10  1:31 ` [PATCH v1 5/5] perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies Ian Rogers
2025-11-11  6:21 ` [PATCH v1 0/5] Remove NO_AUXTRACE build option Namhyung Kim
2025-11-11 18:01   ` Ian Rogers
2025-11-12  9:21     ` James Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).