diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-23 23:08:02 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-26 19:47:05 +0300 |
commit | d88205db9caa0e9d42dde8ff6c2fa0c7b57cd11d (patch) | |
tree | c13897bd36ff309fedbb703bcc6b663b3dde39ee /tools/perf/builtin-top.c | |
parent | efdd5c6b81185223e07452a2f8b5467f81b13d96 (diff) | |
download | linux-d88205db9caa0e9d42dde8ff6c2fa0c7b57cd11d.tar.xz |
perf dso: Add dso__has_symbols() method
To replace longer code sequences in various places.
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-tlk3klbkfyjrbfjvryyznfju@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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4e975f3ee3be..c11b46b411d5 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 && !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ? + al.map && dso__has_symbols(al.map->dso, MAP__FUNCTION) ? " modules" : ""); if (use_browser <= 0) sleep(5); @@ -765,7 +765,7 @@ static void perf_event__process_sample(struct perf_tool *tool, */ if (!machine->kptr_restrict_warned && !top->vmlinux_warned && __map__is_kernel(al.map) && - RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) { + dso__has_symbols(al.map->dso, MAP__FUNCTION)) { if (symbol_conf.vmlinux_name) { char serr[256]; dso__strerror_load(al.map->dso, serr, sizeof(serr)); |