lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/8] perf events: Tidy up perf_event__preprocess_sample
Date
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.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
tools/perf/util/event.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 97c479bcb0dc..b7c7f39a8f6d 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -814,13 +814,14 @@ int perf_event__preprocess_sample(const union perf_event *event,
al->cpu = sample->cpu;

if (al->map) {
+ struct dso *dso = al->map->dso;
+
if (symbol_conf.dso_list &&
- (!al->map || !al->map->dso ||
- !(strlist__has_entry(symbol_conf.dso_list,
- al->map->dso->short_name) ||
- (al->map->dso->short_name != al->map->dso->long_name &&
- strlist__has_entry(symbol_conf.dso_list,
- al->map->dso->long_name)))))
+ (!dso || !(strlist__has_entry(symbol_conf.dso_list,
+ dso->short_name) ||
+ (dso->short_name != dso->long_name &&
+ strlist__has_entry(symbol_conf.dso_list,
+ dso->long_name)))))
goto out_filtered;

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


\
 
 \ /
  Last update: 2011-12-12 16:21    [from the cache]
©2003-2011 Jasper Spaans