diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index bde216b2071c77b8eb24bd161f1f0b1188c48900..4fb6f726271cd2bed5583feba018f2dc52e69658 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -623,10 +623,12 @@ static void *display_thread(void *arg) return NULL; } -static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym) +static int symbol_filter(struct map *map, struct symbol *sym) { const char *name = sym->name; + if (!map->dso->kernel) + return 0; /* * ppc64 uses function descriptors and appends a '.' to the * start of every instruction address. Remove it. diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index f134ec1389347422731839f17d49a23ee77e3e52..35a8bd56cd15c00a32411055632177e1781658a1 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -523,6 +523,10 @@ struct process_kallsyms_args { struct dso *dso; }; +/* + * These are symbols in the kernel image, so make sure that + * sym is from a kernel DSO. + */ bool symbol__is_idle(struct symbol *sym) { const char * const idle_symbols[] = {