diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-23 17:13:49 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-26 13:47:06 -0300 |
commit | e94b861a231501e73d786970ed5a1fb3ea643906 (patch) | |
tree | 03d5e4ceba24394b2b5f7b14a741870d47ab2c07 /tools/perf/builtin-top.c | |
parent | d88205db9caa0e9d42dde8ff6c2fa0c7b57cd11d (diff) | |
download | lwn-e94b861a231501e73d786970ed5a1fb3ea643906.tar.gz lwn-e94b861a231501e73d786970ed5a1fb3ea643906.zip |
perf map: Introduce map__has_symbols()
To further simplify checking if symbols are available for a given map
and to reduce the number of users of MAP__{FUNCTION,VARIABLE}.
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-iyfoyvbfdti5uehgpjum3qrq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index c11b46b411d5..3c061c57afb6 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -742,7 +742,7 @@ static void perf_event__process_sample(struct perf_tool *tool, "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" "Check /proc/sys/kernel/kptr_restrict.\n\n" "Kernel%s samples will not be resolved.\n", - al.map && dso__has_symbols(al.map->dso, MAP__FUNCTION) ? + al.map && map__has_symbols(al.map) ? " modules" : ""); if (use_browser <= 0) sleep(5); @@ -764,8 +764,7 @@ static void perf_event__process_sample(struct perf_tool *tool, * invalid --vmlinux ;-) */ if (!machine->kptr_restrict_warned && !top->vmlinux_warned && - __map__is_kernel(al.map) && - dso__has_symbols(al.map->dso, MAP__FUNCTION)) { + __map__is_kernel(al.map) && map__has_symbols(al.map)) { if (symbol_conf.vmlinux_name) { char serr[256]; dso__strerror_load(al.map->dso, serr, sizeof(serr)); |