linux-next/tools/perf/arch
Ian Rogers e7bb49e3f6 perf x86: Define arch_fetch_insn in NO_AUXTRACE builds
archinsn.c containing arch_fetch_insn was only enabled with
CONFIG_AUXTRACE, but this meant that a NO_AUXTRACE build on x86 would
use the empty weak version of arch_fetch_insn - weak symbols are a
frequent source of errors like this and are outside of the C
specification. Change it so that archinsn.c is always built on x86 and
make the weak symbol empty version of arch_fetch_insn a strong one
guarded by ifdefs.

arch_fetch_insn on x86 depends on insn_decode which is a function
included then built into intel-pt-insn-decoder.c.
intel-pt-insn-decoder.c isn't built in a NO_AUXTRACE=1 build. Separate
the insn_decode function from intel-pt-insn-decoder.c by just directly
compiling the relevant file. Guard this compilation to be for either
always on x86 (because of the use in arch_fetch_insn) or when auxtrace
is enabled. Apply the CFLAGS overrides as necessary, reducing the amount
of code where warnings are disabled.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Veronika Molnarova <vmolnaro@redhat.com>
Cc: Weilin Wang <weilin.wang@intel.com>
Link: https://lore.kernel.org/r/20241119011644.971342-13-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-12-18 16:24:33 -03:00
..
alpha perf tools: Add empty Build files for architectures lacking them 2015-08-06 16:24:15 -03:00
arc/annotate perf disasm: Add e_machine/e_flags to struct arch 2024-11-09 08:39:13 -08:00
arm perf build: Remove PERF_HAVE_DWARF_REGS 2024-11-09 08:39:14 -08:00
arm64 perf pmu: Move pmu_metrics_table__find and remove ARM override 2024-11-16 16:42:36 -03:00
csky perf build: Remove PERF_HAVE_DWARF_REGS 2024-11-09 08:39:14 -08:00
loongarch perf header: Pass a perf_cpu rather than a PMU to get_cpuid_str 2024-11-16 16:40:30 -03:00
mips tools headers: Sync *xattrat syscall changes with the kernel sources 2024-12-04 14:34:50 -08:00
parisc perf tools: Add empty Build files for architectures lacking them 2015-08-06 16:24:15 -03:00
powerpc perf tools arch powerpc: Add register mask for power11 PVR in extended regs 2024-12-18 16:24:31 -03:00
riscv perf header: Pass a perf_cpu rather than a PMU to get_cpuid_str 2024-11-16 16:40:30 -03:00
riscv64/annotate perf disasm: Add e_machine/e_flags to struct arch 2024-11-09 08:39:13 -08:00
s390 tools headers: Sync *xattrat syscall changes with the kernel sources 2024-12-04 14:34:50 -08:00
sh/include perf build: Remove PERF_HAVE_DWARF_REGS 2024-11-09 08:39:14 -08:00
sparc perf build: Remove PERF_HAVE_DWARF_REGS 2024-11-09 08:39:14 -08:00
x86 perf x86: Define arch_fetch_insn in NO_AUXTRACE builds 2024-12-18 16:24:33 -03:00
xtensa/include perf build: Remove PERF_HAVE_DWARF_REGS 2024-11-09 08:39:14 -08:00
Build perf util: Make util its own library 2024-06-26 11:07:42 -07:00
common.c perf tools riscv: Add support for riscv lookup_binutils_path 2023-05-12 15:21:48 -03:00
common.h perf annotate: Own objdump_path and disassembler_style strings 2023-04-04 09:39:56 -03:00