[PATCH v1 0/5] Remove NO_AUXTRACE build option

Ian Rogers posted 5 patches 1 month, 1 week ago
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
[PATCH v1 0/5] Remove NO_AUXTRACE build option
Posted by Ian Rogers 1 month, 1 week ago
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
Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
Posted by Namhyung Kim 1 month, 1 week ago
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
>
Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
Posted by Ian Rogers 1 month, 1 week ago
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
Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
Posted by James Clark 1 month, 1 week ago

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>

Re: [PATCH v1 0/5] Remove NO_AUXTRACE build option
Posted by Namhyung Kim 1 month ago
On Sun, 09 Nov 2025 17:31:47 -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
> of perf and isn't guarding dependencies on any libraries, etc. Clean
> up headers files for auxtrace.h.
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung