Ubuntu-focal-kernel/tools/perf
Leo Yan 30adcae91c perf trace: Handle failure when trace point folder is missed
BugLink: https://bugs.launchpad.net/bugs/2003914

[ Upstream commit 03e9a5d8eb552a1bf692a9c8a5ecd50f4e428006 ]

On Arm64 a case is perf tools fails to find the corresponding trace
point folder for system calls listed in the table 'syscalltbl_arm64',
e.g. the generated system call table contains "lookup_dcookie" but we
cannot find out the matched trace point folder for it.

We need to figure out if there have any issue for the generated system
call table, on the other hand, we need to handle the case when trace
point folder is missed under sysfs, this patch sets the flag
syscall::nonexistent as true and returns the error from
trace__read_syscall_info().

Another problem is for trace__syscall_info(), it returns two different
values if a system call doesn't exist: at the first time calling
trace__syscall_info() it returns NULL when the system call doesn't exist,
later if call trace__syscall_info() again for the same missed system
call, it returns pointer of syscall.  trace__syscall_info() checks the
condition 'syscalls.table[id].name == NULL', but the name will be
assigned in the first invoking even the system call is not found.

So checking system call's name in trace__syscall_info() is not the right
thing to do, this patch simply checks flag syscall::nonexistent to make
decision if a system call exists or not, finally trace__syscall_info()
returns the consistent result (NULL) if a system call doesn't existed.

Fixes: b8b1033fca ("perf trace: Mark syscall ids that are not allocated to avoid unnecessary error messages")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: bpf@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221121075237.127706-4-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2023-02-01 15:23:01 +01:00
..
Documentation
arch
bench perf bench numa: Address compiler error on s390 2022-08-26 11:06:48 +02:00
examples/bpf
include/bpf
jvmti
lib
pmu-events perf jevents: Fix event syntax error caused by ExtSel 2022-08-26 11:08:19 +02:00
python tweewide: Fix most Shebang lines 2021-06-18 15:02:27 +02:00
scripts perf scripts python: exported-sql-viewer.py: Fix warning display 2021-06-18 15:02:41 +02:00
tests perf tests: Remove bash construct from record+zstd_comp_decomp.sh 2022-01-13 18:42:58 +01:00
trace perf trace: Add the syscall_arg_fmt pointer to syscall_arg 2023-02-01 15:23:00 +01:00
ui perf hist: Fix memory leak of a perf_hpp_fmt 2022-02-03 18:57:21 +01:00
util perf stat: Fix printing os->prefix in CSV metrics output 2023-02-01 15:20:58 +01:00
.gitignore
Build
CREDITS
MANIFEST
Makefile
Makefile.config tools build: Filter out options and warnings not supported by clang 2022-05-20 15:20:03 +02:00
Makefile.perf
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix sorting in percent_rmt_hitm_cmp() 2022-08-26 11:09:05 +02:00
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace: Fix access to pid in array when setting a pid filter 2021-05-19 10:53:23 +02:00
builtin-help.c
builtin-inject.c perf inject: Close inject.output on exit 2021-09-20 18:49:41 +02:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c
builtin-report.c perf report: Fix memory leaks around perf_tip() 2022-02-03 18:57:21 +01:00
builtin-sched.c
builtin-script.c perf script: Fix CPU filtering of a script's switch events 2022-03-07 16:34:50 +01:00
builtin-stat.c
builtin-timechart.c
builtin-top.c
builtin-trace.c perf trace: Handle failure when trace point folder is missed 2023-02-01 15:23:01 +01:00
builtin-version.c
builtin.h
check-headers.sh x86: xen: insn: Decode Xen and KVM emulate-prefix signature 2022-07-11 16:39:55 +02:00
command-list.txt
design.txt
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Fix perf's libperf_print callback 2022-05-20 15:19:59 +02:00
perf.h