diff options
author | 2010-05-09 11:47:13 -0300 | |
---|---|---|
committer | 2010-05-09 13:07:05 -0300 | |
commit | 139633c6a43781cd44798165b0472a34bf53a1e8 (patch) | |
tree | 17c2412ccb2993846488153e8dcc2c7015d260d1 /tools/perf/util/callchain.c | |
parent | perf report: Document '--call-graph' better for usage (diff) | |
download | linux-139633c6a43781cd44798165b0472a34bf53a1e8.tar.gz linux-139633c6a43781cd44798165b0472a34bf53a1e8.tar.bz2 linux-139633c6a43781cd44798165b0472a34bf53a1e8.zip |
perf callchain: Move validate_callchain to callchain lib
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r-- | tools/perf/util/callchain.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index db628af6d20d..ac148613afe8 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -17,6 +17,13 @@ #include "callchain.h" +bool ip_callchain__valid(struct ip_callchain *chain, event_t *event) +{ + unsigned int chain_size = event->header.size; + chain_size -= (unsigned long)&event->ip.__more_data - (unsigned long)event; + return chain->nr * sizeof(u64) <= chain_size; +} + #define chain_for_each_child(child, parent) \ list_for_each_entry(child, &parent->children, brothers) |