perf parse-regs: Remove unused macros PERF_REG_{IP|SP}The macros PERF_REG_{IP|SP} have been replaced by using functionsperf_arch_reg_{ip|sp}(), remove them!Signed-off-by: Leo Yan <leo.yan@linaro
perf parse-regs: Remove unused macros PERF_REG_{IP|SP}The macros PERF_REG_{IP|SP} have been replaced by using functionsperf_arch_reg_{ip|sp}(), remove them!Signed-off-by: Leo Yan <leo.yan@linaro.org>Acked-by: Ian Rogers <irogers@google.com>Cc: Adrian Hunter <adrian.hunter@intel.com>Cc: Albert Ou <aou@eecs.berkeley.edu>Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>Cc: Eric Lin <eric.lin@sifive.com>Cc: Fangrui Song <maskray@google.com>Cc: Guo Ren <guoren@kernel.org>Cc: Huacai Chen <chenhuacai@kernel.org>Cc: Ingo Molnar <mingo@redhat.com>Cc: Ivan Babrou <ivan@cloudflare.com>Cc: James Clark <james.clark@arm.com>Cc: Jiri Olsa <jolsa@kernel.org>Cc: John Garry <john.g.garry@oracle.com>Cc: Kan Liang <kan.liang@linux.intel.com>Cc: Mark Rutland <mark.rutland@arm.com>Cc: Mike Leach <mike.leach@linaro.org>Cc: Ming Wang <wangming01@loongson.cn>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Palmer Dabbelt <palmer@dabbelt.com>Cc: Paul Walmsley <paul.walmsley@sifive.com>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Sandipan Das <sandipan.das@amd.com>Cc: Will Deacon <will@kernel.org>Cc: linux-arm-kernel@lists.infradead.orgCc: linux-csky@vger.kernel.orgCc: linux-riscv@lists.infradead.orgLink: https://lore.kernel.org/r/20230606014559.21783-5-leo.yan@linaro.orgSigned-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
perf arch: Support register names from all archsWhen reading a perf.data file with register values, there is a mismatchbetween the names and the values of the registers because the tool isbuilt u
perf arch: Support register names from all archsWhen reading a perf.data file with register values, there is a mismatchbetween the names and the values of the registers because the tool isbuilt using only the register names from the local architecture.Reading a perf.data file that was recorded on ARM64, gives the followingerroneous 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, eventhough the perf.data file was recorded on an ARM64 system. After thispatch, 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 inpowerpc and doing perf report to read the data from x86."Reported-by: Alexandre Truong <alexandre.truong@arm.com>Reviewed-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>Signed-off-by: German Gomez <german.gomez@arm.com>Tested-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>Cc: Jiri Olsa <jolsa@redhat.com>Cc: John Garry <john.garry@huawei.com>Cc: Leo Yan <leo.yan@linaro.org>Cc: Mark Rutland <mark.rutland@arm.com>Cc: Mathieu Poirier <mathieu.poirier@linaro.org>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Will Deacon <will@kernel.org>Cc: linux-arm-kernel@lists.infradead.orgCc: linux-csky@vger.kernel.orgCc: linux-riscv@lists.infradead.orgLink: https://lore.kernel.org/r/20211207180653.1147374-4-german.gomez@arm.comSigned-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
perf tools: Support MIPS unwinding and dwarf-regsMap perf APIs (perf_reg_name/get_arch_regstr/unwind__arch_reg_id) withMIPS specific registers.[ayan@wavecomp.com: repick this patch for unwinding
perf tools: Support MIPS unwinding and dwarf-regsMap perf APIs (perf_reg_name/get_arch_regstr/unwind__arch_reg_id) withMIPS specific registers.[ayan@wavecomp.com: repick this patch for unwinding userstack backtraceby perf and libunwind on MIPS based CPU.][yangtiezhu@loongson.cn: Add sample_reg_masks[] to fix build error,silence some checkpatch errors and warnings, and also separate theoriginal patches into two parts (MIPS kernel and perf tools) to mergeeasily.]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: 067012974c8ae31a ("perf tools: Fix arm64 build error with gcc-11")Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>Cc: Archer Yan <ayan@wavecomp.com>Cc: David Daney <david.daney@cavium.com>Cc: Jianlin Lv <Jianlin.Lv@arm.com>Cc: Jiri Olsa <jolsa@redhat.com>Cc: Juxin Gao <gaojuxin@loongson.cn>Cc: Mark Rutland <mark.rutland@arm.com>Cc: Namhyung Kim <namhyung@kernel.org>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Ralf Baechle <ralf@linux-mips.org>Cc: Xuefeng Li <lixuefeng@loongson.cn>Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>Cc: linux-mips@vger.kernel.orgLink: http://lore.kernel.org/lkml/1612409724-3516-3-git-send-email-yangtiezhu@loongson.cnSigned-off-by: Archer Yan <ayan@wavecomp.com>Signed-off-by: David Daney <david.daney@cavium.com>Signed-off-by: Ralf Baechle <ralf@linux-mips.org>Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>