Dapeng Mi
e716e69cf6
perf arch: Update arch headers to use relative UAPI paths
...
The architectural specific headers perf_regs.h currently rely on the
host architecture's 'asm/perf_regs.h'.
This can lead to compilation inconsistencies or failures when including
and building perf for a target architecture that differs from the host's
architecture.
Explicitly point to the UAPI headers within the tools source tree using
relative paths.
This ensures that perf is always built against the intended
architecture.
No functional changes are intended.
Reviewed-by: Ian Rogers <[email protected] >
Signed-off-by: Dapeng Mi <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Albert Ou <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Guo Ren <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: John Garry <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Paul Walmsley <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Thomas Falcon <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Xudong Hao <[email protected] >
Cc: Zide Chen <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2026-02-06 12:15:48 -03:00
Ian Rogers
af472d3c44
perf syscalltbl: Remove syscall_table.h
...
The definition of "static const char *const syscalltbl[] = {" is done
in a generated syscalls_32.h or syscalls_64.h that is architecture
dependent. In order to include the appropriate file a syscall_table.h
is found via the perf include path and it includes the syscalls_32.h
or syscalls_64.h as appropriate.
To support having multiple syscall tables, one for 32-bit and one for
64-bit, or for different architectures, an include path cannot be
used. Remove syscall_table.h because of this and inline what it does
into syscalltbl.c.
For architectures without a syscall_table.h this will cause a failure
to include either syscalls_32.h or syscalls_64.h rather than a failure
to include syscall_table.h. For architectures that only included one
or other, the behavior matches BITS_PER_LONG as previously done on
architectures supporting both syscalls_32.h and syscalls_64.h.
Signed-off-by: Ian Rogers <[email protected] >
Reviewed-by: Howard Chu <[email protected] >
Reviewed-by: Charlie Jenkins <[email protected] >
Reviewed-by: Namhyung Kim <[email protected] >
Acked-by: Arnaldo Carvalho de Melo <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2025-03-20 22:57:35 -07:00
Charlie Jenkins
619ffe6694
perf tools mips: Use generic syscall scripts
...
Use the generic scripts to generate headers from the syscall table for
mips.
Signed-off-by: Charlie Jenkins <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Cc: Christian Brauner <[email protected] >
Cc: Guo Ren <[email protected] >
Cc: Günther Noack <[email protected] >
Cc: Ian Rogers <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Jonathan Corbet <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Mickaël Salaün <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Paul Walmsley <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Will Deacon <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2025-01-09 12:56:20 -03:00
Leo Yan
6a87e0f0ce
perf parse-regs: Remove unused macros PERF_REG_{IP|SP}
...
The macros PERF_REG_{IP|SP} have been replaced by using functions
perf_arch_reg_{ip|sp}(), remove them!
Signed-off-by: Leo Yan <[email protected] >
Acked-by: Ian Rogers <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Albert Ou <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Eric Lin <[email protected] >
Cc: Fangrui Song <[email protected] >
Cc: Guo Ren <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Ivan Babrou <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Ming Wang <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Cc: Paul Walmsley <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Sandipan Das <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2023-08-16 08:48:06 -03:00
German Gomez
83869019c7
perf arch: Support register names from all archs
...
When reading a perf.data file with register values, there is a mismatch
between the names and the values of the registers because the tool is
built using only the register names from the local architecture.
Reading a perf.data file that was recorded on ARM64, gives the following
erroneous output on an X86 machine:
# perf report -i perf_arm64.data -D
[...]
24661932634451 0x698 [0x21d0]: PERF_RECORD_SAMPLE(IP, 0x1): 43239/43239: 0xffffc5be8f100f98 period: 1 addr: 0
... user regs: mask 0x1ffffffff ABI 64-bit
.... AX 0x0000ffffd1515817
.... BX 0x0000ffffd1515480
.... CX 0x0000aaaadabf6c80
.... DX 0x000000000000002e
.... SI 0x0000000040100401
.... DI 0x0040600200000080
.... BP 0x0000ffffd1510e10
.... SP 0x0000000000000000
.... IP 0x00000000000000dd
.... FLAGS 0x0000ffffd1510cd0
.... CS 0x0000000000000000
.... SS 0x0000000000000030
.... DS 0x0000ffffa569a208
.... ES 0x0000000000000000
.... FS 0x0000000000000000
.... GS 0x0000000000000000
.... R8 0x0000aaaad3de9650
.... R9 0x0000ffffa57397f0
.... R10 0x0000000000000001
.... R11 0x0000ffffa57fd000
.... R12 0x0000ffffd1515817
.... R13 0x0000ffffd1515480
.... R14 0x0000aaaadabf6c80
.... R15 0x0000000000000000
.... unknown 0x0000000000000001
.... unknown 0x0000000000000000
.... unknown 0x0000000000000000
.... unknown 0x0000000000000000
.... unknown 0x0000000000000000
.... unknown 0x0000ffffd1510d90
.... unknown 0x0000ffffa5739b90
.... unknown 0x0000ffffd1510d80
.... XMM0 0x0000ffffa57392c8
... thread: perf-exec:43239
...... dso: [kernel.kallsyms]
As can be seen, the register names correspond to X86 registers, even
though the perf.data file was recorded on an ARM64 system. After this
patch, the output of the command displays the correct register names:
# perf report -i perf_arm64.data -D
[...]
24661932634451 0x698 [0x21d0]: PERF_RECORD_SAMPLE(IP, 0x1): 43239/43239: 0xffffc5be8f100f98 period: 1 addr: 0
... user regs: mask 0x1ffffffff ABI 64-bit
.... x0 0x0000ffffd1515817
.... x1 0x0000ffffd1515480
.... x2 0x0000aaaadabf6c80
.... x3 0x000000000000002e
.... x4 0x0000000040100401
.... x5 0x0040600200000080
.... x6 0x0000ffffd1510e10
.... x7 0x0000000000000000
.... x8 0x00000000000000dd
.... x9 0x0000ffffd1510cd0
.... x10 0x0000000000000000
.... x11 0x0000000000000030
.... x12 0x0000ffffa569a208
.... x13 0x0000000000000000
.... x14 0x0000000000000000
.... x15 0x0000000000000000
.... x16 0x0000aaaad3de9650
.... x17 0x0000ffffa57397f0
.... x18 0x0000000000000001
.... x19 0x0000ffffa57fd000
.... x20 0x0000ffffd1515817
.... x21 0x0000ffffd1515480
.... x22 0x0000aaaadabf6c80
.... x23 0x0000000000000000
.... x24 0x0000000000000001
.... x25 0x0000000000000000
.... x26 0x0000000000000000
.... x27 0x0000000000000000
.... x28 0x0000000000000000
.... x29 0x0000ffffd1510d90
.... lr 0x0000ffffa5739b90
.... sp 0x0000ffffd1510d80
.... pc 0x0000ffffa57392c8
... thread: perf-exec:43239
...... dso: [kernel.kallsyms]
Tester comments:
Athira reports:
"Looks good to me. Tested this patchset in powerpc by capturing regs in
powerpc and doing perf report to read the data from x86."
Reported-by: Alexandre Truong <[email protected] >
Reviewed-by: Athira Jajeev <[email protected] >
Signed-off-by: German Gomez <[email protected] >
Tested-by: Athira Jajeev <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Mathieu Poirier <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2021-12-16 12:18:12 -03:00
Tiezhu Yang
b5f184fbdb
perf tools: Support MIPS unwinding and dwarf-regs
...
Map perf APIs (perf_reg_name/get_arch_regstr/unwind__arch_reg_id) with
MIPS specific registers.
[[email protected] : repick this patch for unwinding userstack backtrace
by perf and libunwind on MIPS based CPU.]
[[email protected] : Add sample_reg_masks[] to fix build error,
silence some checkpatch errors and warnings, and also separate the
original patches into two parts (MIPS kernel and perf tools) to merge
easily.]
The original patches:
https://lore.kernel.org/patchwork/patch/1126521/
https://lore.kernel.org/patchwork/patch/1126520/
Committer notes:
Do it as __perf_reg_name() to cope with:
067012974c ("perf tools: Fix arm64 build error with gcc-11")
Signed-off-by: Tiezhu Yang <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Archer Yan <[email protected] >
Cc: David Daney <[email protected] >
Cc: Jianlin Lv <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Juxin Gao <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Ralf Baechle <[email protected] >
Cc: Xuefeng Li <[email protected] >
Cc: Thomas Bogendoerfer <[email protected] >
Cc: [email protected]
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Archer Yan <[email protected] >
Signed-off-by: David Daney <[email protected] >
Signed-off-by: Ralf Baechle <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2021-03-01 14:47:50 -03:00