diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-11 19:45:41 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-28 07:37:43 -0500 |
commit | 10d0f086df77f3ff259b46cb501362dbaf2c7989 (patch) | |
tree | 69c8d8ccca5545c524abe0ac52a149e78fbc279f /tools/perf/util/session.c | |
parent | 81e36bffad95e015af9741b5b1ee16afe08aab05 (diff) |
perf event: perf_event_ops->attr() manipulates only an evlist
Removing another case where a perf_session is required when processing
events.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ug1wtjbnva4bxwknflkkrlrh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 675e080f66b6..6e7d5f54b37d 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -277,6 +277,13 @@ static int process_event_synth_stub(union perf_event *event __used, | |||
277 | return 0; | 277 | return 0; |
278 | } | 278 | } |
279 | 279 | ||
280 | static int process_event_synth_attr_stub(union perf_event *event __used, | ||
281 | struct perf_evlist **pevlist __used) | ||
282 | { | ||
283 | dump_printf(": unhandled!\n"); | ||
284 | return 0; | ||
285 | } | ||
286 | |||
280 | static int process_event_sample_stub(union perf_event *event __used, | 287 | static int process_event_sample_stub(union perf_event *event __used, |
281 | struct perf_sample *sample __used, | 288 | struct perf_sample *sample __used, |
282 | struct perf_evsel *evsel __used, | 289 | struct perf_evsel *evsel __used, |
@@ -327,7 +334,7 @@ static void perf_event_ops__fill_defaults(struct perf_event_ops *handler) | |||
327 | if (handler->unthrottle == NULL) | 334 | if (handler->unthrottle == NULL) |
328 | handler->unthrottle = process_event_stub; | 335 | handler->unthrottle = process_event_stub; |
329 | if (handler->attr == NULL) | 336 | if (handler->attr == NULL) |
330 | handler->attr = process_event_synth_stub; | 337 | handler->attr = process_event_synth_attr_stub; |
331 | if (handler->event_type == NULL) | 338 | if (handler->event_type == NULL) |
332 | handler->event_type = process_event_synth_stub; | 339 | handler->event_type = process_event_synth_stub; |
333 | if (handler->tracing_data == NULL) | 340 | if (handler->tracing_data == NULL) |
@@ -794,12 +801,17 @@ static int perf_session__preprocess_sample(struct perf_session *session, | |||
794 | static int perf_session__process_user_event(struct perf_session *session, union perf_event *event, | 801 | static int perf_session__process_user_event(struct perf_session *session, union perf_event *event, |
795 | struct perf_event_ops *ops, u64 file_offset) | 802 | struct perf_event_ops *ops, u64 file_offset) |
796 | { | 803 | { |
804 | int err; | ||
805 | |||
797 | dump_event(session, event, file_offset, NULL); | 806 | dump_event(session, event, file_offset, NULL); |
798 | 807 | ||
799 | /* These events are processed right away */ | 808 | /* These events are processed right away */ |
800 | switch (event->header.type) { | 809 | switch (event->header.type) { |
801 | case PERF_RECORD_HEADER_ATTR: | 810 | case PERF_RECORD_HEADER_ATTR: |
802 | return ops->attr(event, session); | 811 | err = ops->attr(event, &session->evlist); |
812 | if (err == 0) | ||
813 | perf_session__update_sample_type(session); | ||
814 | return err; | ||
803 | case PERF_RECORD_HEADER_EVENT_TYPE: | 815 | case PERF_RECORD_HEADER_EVENT_TYPE: |
804 | return ops->event_type(event, session); | 816 | return ops->event_type(event, session); |
805 | case PERF_RECORD_HEADER_TRACING_DATA: | 817 | case PERF_RECORD_HEADER_TRACING_DATA: |