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

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

perf top: Use __map__is_kernel()

Shorter form to figure out if a given map is the kernel one and also
reduces the number of code accessing MAP__{FUNCTION,VARIABLE}, that
should go away at some point.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-rn8pexelsxpx92ce3elu3wiw@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent abc60bad
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -750,7 +750,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
		machine->kptr_restrict_warned = true;
		machine->kptr_restrict_warned = true;
	}
	}


	if (al.sym == NULL) {
	if (al.sym == NULL && al.map != NULL) {
		const char *msg = "Kernel samples will not be resolved.\n";
		const char *msg = "Kernel samples will not be resolved.\n";
		/*
		/*
		 * As we do lazy loading of symtabs we only will know if the
		 * As we do lazy loading of symtabs we only will know if the
@@ -764,7 +764,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
		 * invalid --vmlinux ;-)
		 * invalid --vmlinux ;-)
		 */
		 */
		if (!machine->kptr_restrict_warned && !top->vmlinux_warned &&
		if (!machine->kptr_restrict_warned && !top->vmlinux_warned &&
		    al.map == machine->vmlinux_maps[MAP__FUNCTION] &&
		    __map__is_kernel(al.map) &&
		    RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) {
		    RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) {
			if (symbol_conf.vmlinux_name) {
			if (symbol_conf.vmlinux_name) {
				char serr[256];
				char serr[256];