aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-05-07 04:51:38 -0400
committerIngo Molnar <mingo@elte.hu>2011-05-07 04:51:48 -0400
commit4cb1f43ce8c72ee453c00fcb9f6ee9c4ebd03f98 (patch)
tree15e64f192b54ea01fd640d69eed0cabed2baaaa9 /tools/perf/builtin-script.c
parent9de4966a4d218f29c68e96e8e7b4d2840dedec79 (diff)
parent0ee5623f9a6e52df90a78bd21179f8ab370e102e (diff)
Merge commit 'v2.6.39-rc6' into x86/cleanups
Merge reason: move to a (much) newer upstream base. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9f5fc5492141..ac574ea23917 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -162,19 +162,11 @@ static void print_sample_start(struct perf_sample *sample,
162 162
163static void process_event(union perf_event *event __unused, 163static void process_event(union perf_event *event __unused,
164 struct perf_sample *sample, 164 struct perf_sample *sample,
165 struct perf_evsel *evsel,
165 struct perf_session *session, 166 struct perf_session *session,
166 struct thread *thread) 167 struct thread *thread)
167{ 168{
168 struct perf_event_attr *attr; 169 struct perf_event_attr *attr = &evsel->attr;
169 struct perf_evsel *evsel;
170
171 evsel = perf_evlist__id2evsel(session->evlist, sample->id);
172 if (evsel == NULL) {
173 pr_err("Invalid data. Contains samples with id not in "
174 "its header!\n");
175 return;
176 }
177 attr = &evsel->attr;
178 170
179 if (output_fields[attr->type] == 0) 171 if (output_fields[attr->type] == 0)
180 return; 172 return;
@@ -244,6 +236,7 @@ static char const *input_name = "perf.data";
244 236
245static int process_sample_event(union perf_event *event, 237static int process_sample_event(union perf_event *event,
246 struct perf_sample *sample, 238 struct perf_sample *sample,
239 struct perf_evsel *evsel,
247 struct perf_session *session) 240 struct perf_session *session)
248{ 241{
249 struct thread *thread = perf_session__findnew(session, event->ip.pid); 242 struct thread *thread = perf_session__findnew(session, event->ip.pid);
@@ -264,7 +257,7 @@ static int process_sample_event(union perf_event *event,
264 last_timestamp = sample->time; 257 last_timestamp = sample->time;
265 return 0; 258 return 0;
266 } 259 }
267 scripting_ops->process_event(event, sample, session, thread); 260 scripting_ops->process_event(event, sample, evsel, session, thread);
268 261
269 session->hists.stats.total_period += sample->period; 262 session->hists.stats.total_period += sample->period;
270 return 0; 263 return 0;