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>
This commit is contained in:
Arnaldo Carvalho de Melo 2018-04-23 17:08:02 -03:00
parent efdd5c6b81
commit d88205db9c
3 changed files with 8 additions and 3 deletions

View file

@ -525,7 +525,7 @@ static void report__warn_kptr_restrict(const struct report *rep)
if (kernel_map) {
const struct dso *kdso = kernel_map->dso;
if (!RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION])) {
if (dso__has_symbols(kdso, MAP__FUNCTION)) {
desc = "If some relocation was applied (e.g. "
"kexec) symbols may be misresolved.";
}