aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 10:47:13 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 12:07:05 -0400
commit139633c6a43781cd44798165b0472a34bf53a1e8 (patch)
tree17c2412ccb2993846488153e8dcc2c7015d260d1 /tools/perf/builtin-report.c
parente157eb8341e7885ff2d9f1620155e3da6e0c8f56 (diff)
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/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 196473b51257..1cae87713792 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -123,19 +123,6 @@ static int perf_session__add_hist_entry(struct perf_session *self,
123 return 0; 123 return 0;
124} 124}
125 125
126static int validate_chain(struct ip_callchain *chain, event_t *event)
127{
128 unsigned int chain_size;
129
130 chain_size = event->header.size;
131 chain_size -= (unsigned long)&event->ip.__more_data - (unsigned long)event;
132
133 if (chain->nr*sizeof(u64) > chain_size)
134 return -1;
135
136 return 0;
137}
138
139static int add_event_total(struct perf_session *session, 126static int add_event_total(struct perf_session *session,
140 struct sample_data *data, 127 struct sample_data *data,
141 struct perf_event_attr *attr) 128 struct perf_event_attr *attr)
@@ -171,7 +158,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
171 158
172 dump_printf("... chain: nr:%Lu\n", data.callchain->nr); 159 dump_printf("... chain: nr:%Lu\n", data.callchain->nr);
173 160
174 if (validate_chain(data.callchain, event) < 0) { 161 if (!ip_callchain__valid(data.callchain, event)) {
175 pr_debug("call-chain problem with event, " 162 pr_debug("call-chain problem with event, "
176 "skipping it.\n"); 163 "skipping it.\n");
177 return 0; 164 return 0;