diff options
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 @@ | |||
17 | 17 | ||
18 | #include "callchain.h" | 18 | #include "callchain.h" |
19 | 19 | ||
20 | bool ip_callchain__valid(struct ip_callchain *chain, event_t *event) | ||
21 | { | ||
22 | unsigned int chain_size = event->header.size; | ||
23 | chain_size -= (unsigned long)&event->ip.__more_data - (unsigned long)event; | ||
24 | return chain->nr * sizeof(u64) <= chain_size; | ||
25 | } | ||
26 | |||
20 | #define chain_for_each_child(child, parent) \ | 27 | #define chain_for_each_child(child, parent) \ |
21 | list_for_each_entry(child, &parent->children, brothers) | 28 | list_for_each_entry(child, &parent->children, brothers) |
22 | 29 | ||