diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-25 20:53:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-25 20:53:09 -0400 |
commit | 2a20b02c055a14eb60ac8da737d79dc940bb9ee0 (patch) | |
tree | 1cf09a5e13f8ed24bc66386c153969ad49f8f098 /tools/perf/builtin-script.c | |
parent | 839767e79e7bdf06f241a47701f0f64b8e2d3f61 (diff) | |
parent | 45daae575e08bbf7405c5a3633e956fa364d1b4f (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf, x86: Complain louder about BIOSen corrupting CPU/PMU state and continue
perf, x86: P4 PMU - Read proper MSR register to catch unflagged overflows
perf symbols: Look at .dynsym again if .symtab not found
perf build-id: Add quirk to deal with perf.data file format breakage
perf session: Pass evsel in event_ops->sample()
perf: Better fit max unprivileged mlock pages for tools needs
perf_events: Fix stale ->cgrp pointer in update_cgrp_time_from_cpuctx()
perf top: Fix uninitialized 'counter' variable
tracing: Fix set_ftrace_filter probe function display
perf, x86: Fix Intel fixed counters base initialization
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 15 |
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 | ||
163 | static void process_event(union perf_event *event __unused, | 163 | static 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 | ||
245 | static int process_sample_event(union perf_event *event, | 237 | static 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; |