[tip:perf/core] perf events: Tidy up perf_event__preprocess_sample

From: tip-bot for Namhyung Kim
Date: Wed Dec 21 2011 - 03:47:19 EST


Commit-ID: cb8f4e9aa37c469ddd80dda51469f327606c0118
Gitweb: http://git.kernel.org/tip/cb8f4e9aa37c469ddd80dda51469f327606c0118
Author: Namhyung Kim <namhyung@xxxxxxxxx>
AuthorDate: Tue, 13 Dec 2011 00:16:55 +0900
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Tue, 20 Dec 2011 13:50:59 -0200

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@xxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1323703017-6060-7-git-send-email-namhyung@xxxxxxxxx
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
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 97c479b..b7c7f39 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/