Skip to content

Commit 058b38c

Browse files
committed
perf top: Don't complain about lack of vmlinux when not resolving some kernel samples
Recently we got a case where a kernel sample wasn't being resolved due to a bug that was not setting the end address on kernel functions implemented in assembly (see Link: tag), and then those were not being found by machine__resolve() -> map__find_symbol(). So we ended up with: # perf top --stdio PerfTop: 0 irqs/s kernel: 0% exact: 0% lost: 0/0 drop: 0/0 [cycles/P] ----------------------------------------------------------------------- Warning: A vmlinux file was not found. Kernel samples will not be resolved. ^Z [1]+ Stopped perf top --stdio # But then resolving all other kernel symbols. So just fixup the logic to only print that warning when there are no symbols in the kernel map. Fixes: d88205d ("perf dso: Add dso__has_symbols() method") Reviewed-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Link: https://lore.kernel.org/lkml/Z3buKhcCsZi3_aGb@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ed60738 commit 058b38c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ static void perf_event__process_sample(const struct perf_tool *tool,
809809
* invalid --vmlinux ;-)
810810
*/
811811
if (!machine->kptr_restrict_warned && !top->vmlinux_warned &&
812-
__map__is_kernel(al.map) && map__has_symbols(al.map)) {
812+
__map__is_kernel(al.map) && !map__has_symbols(al.map)) {
813813
if (symbol_conf.vmlinux_name) {
814814
char serr[256];
815815

0 commit comments

Comments
 (0)