Skip to content

Commit cb8f4e9

Browse files
namhyungacmel
authored andcommitted
perf events: Tidy up perf_event__preprocess_sample
Use local variable 'dso' to reduce typing a bit and rearrange the if condition. Also NULL check of al->map in the condition is not necessary. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1323703017-6060-7-git-send-email-namhyung@gmail.com Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 5f9273d commit cb8f4e9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎tools/perf/util/event.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,14 @@ int perf_event__preprocess_sample(const union perf_event *event,
814814
al->cpu = sample->cpu;
815815

816816
if (al->map) {
817+
struct dso *dso = al->map->dso;
818+
817819
if (symbol_conf.dso_list &&
818-
(!al->map || !al->map->dso ||
819-
!(strlist__has_entry(symbol_conf.dso_list,
820-
al->map->dso->short_name) ||
821-
(al->map->dso->short_name != al->map->dso->long_name &&
822-
strlist__has_entry(symbol_conf.dso_list,
823-
al->map->dso->long_name)))))
820+
(!dso || !(strlist__has_entry(symbol_conf.dso_list,
821+
dso->short_name) ||
822+
(dso->short_name != dso->long_name &&
823+
strlist__has_entry(symbol_conf.dso_list,
824+
dso->long_name)))))
824825
goto out_filtered;
825826

826827
al->sym = map__find_symbol(al->map, al->addr, filter);

0 commit comments

Comments
 (0)