diff options
author | Arnaldo Carvalho de Melo | 2018-04-23 17:08:02 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2018-04-26 13:47:05 -0300 |
commit | d88205db9caa0e9d42dde8ff6c2fa0c7b57cd11d (patch) | |
tree | c13897bd36ff309fedbb703bcc6b663b3dde39ee /tools/perf/util | |
parent | efdd5c6b81185223e07452a2f8b5467f81b13d96 (diff) |
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/util')
-rw-r--r-- | tools/perf/util/dso.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index c229dbe0277a..881d572be6aa 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -233,6 +233,11 @@ static inline void __dso__zput(struct dso **dso) bool dso__loaded(const struct dso *dso, enum map_type type); +static inline bool dso__has_symbols(const struct dso *dso, enum map_type type) +{ + return !RB_EMPTY_ROOT(&dso->symbols[type]); +} + bool dso__sorted_by_name(const struct dso *dso, enum map_type type); void dso__set_sorted_by_name(struct dso *dso, enum map_type type); void dso__sort_by_name(struct dso *dso, enum map_type type); |