Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7110b9f authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf top: Don't look for kernel idle symbols in all DSOs

The 'top' tool initially supported only kernel symbols, when making it
support userspace symbols we forgot to make the symbol filter first
check that the DSO is the kernel one. Fix it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
 c: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-54haztkeigmbump5sexxnzhv@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ddcd0973
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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.
+4 −0
Original line number Diff line number Diff line
@@ -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[] = {