diff options
author | Tom Zanussi <tzanussi@gmail.com> | 2010-04-02 00:59:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-14 05:56:08 -0400 |
commit | c7929e4727e8ff2d6fc8327188820e3b1c2f1dc3 (patch) | |
tree | 59f85cc7a5a381761f1583624f1ce2d62c060e5d /tools/perf/util/session.c | |
parent | 9215545e99d8c0b27323df2de504f4294bf5e407 (diff) |
perf: Convert perf header build_ids into build_id events
Bypasses the build_id perf header code and replaces it with a
synthesized event and processing function that accomplishes the
same thing, used when reading/writing perf data to/from a pipe.
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
Cc: k-keiichi@bx.jp.nec.com
Cc: acme@ghostprotocols.net
LKML-Reference: <1270184365-8281-9-git-send-email-tzanussi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 1516c40d47a..0fdf3ebef1e 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -206,6 +206,8 @@ static void perf_event_ops__fill_defaults(struct perf_event_ops *handler) | |||
206 | handler->event_type = process_event_stub; | 206 | handler->event_type = process_event_stub; |
207 | if (handler->tracing_data == NULL) | 207 | if (handler->tracing_data == NULL) |
208 | handler->tracing_data = process_event_stub; | 208 | handler->tracing_data = process_event_stub; |
209 | if (handler->build_id == NULL) | ||
210 | handler->build_id = process_event_stub; | ||
209 | } | 211 | } |
210 | 212 | ||
211 | static const char *event__name[] = { | 213 | static const char *event__name[] = { |
@@ -222,6 +224,7 @@ static const char *event__name[] = { | |||
222 | [PERF_RECORD_HEADER_ATTR] = "ATTR", | 224 | [PERF_RECORD_HEADER_ATTR] = "ATTR", |
223 | [PERF_RECORD_HEADER_EVENT_TYPE] = "EVENT_TYPE", | 225 | [PERF_RECORD_HEADER_EVENT_TYPE] = "EVENT_TYPE", |
224 | [PERF_RECORD_HEADER_TRACING_DATA] = "TRACING_DATA", | 226 | [PERF_RECORD_HEADER_TRACING_DATA] = "TRACING_DATA", |
227 | [PERF_RECORD_HEADER_BUILD_ID] = "BUILD_ID", | ||
225 | }; | 228 | }; |
226 | 229 | ||
227 | unsigned long event__total[PERF_RECORD_HEADER_MAX]; | 230 | unsigned long event__total[PERF_RECORD_HEADER_MAX]; |
@@ -332,6 +335,7 @@ static event__swap_op event__swap_ops[] = { | |||
332 | [PERF_RECORD_HEADER_ATTR] = event__attr_swap, | 335 | [PERF_RECORD_HEADER_ATTR] = event__attr_swap, |
333 | [PERF_RECORD_HEADER_EVENT_TYPE] = event__event_type_swap, | 336 | [PERF_RECORD_HEADER_EVENT_TYPE] = event__event_type_swap, |
334 | [PERF_RECORD_HEADER_TRACING_DATA] = event__tracing_data_swap, | 337 | [PERF_RECORD_HEADER_TRACING_DATA] = event__tracing_data_swap, |
338 | [PERF_RECORD_HEADER_BUILD_ID] = NULL, | ||
335 | [PERF_RECORD_HEADER_MAX] = NULL, | 339 | [PERF_RECORD_HEADER_MAX] = NULL, |
336 | }; | 340 | }; |
337 | 341 | ||
@@ -380,6 +384,8 @@ static int perf_session__process_event(struct perf_session *self, | |||
380 | /* setup for reading amidst mmap */ | 384 | /* setup for reading amidst mmap */ |
381 | lseek(self->fd, offset + head, SEEK_SET); | 385 | lseek(self->fd, offset + head, SEEK_SET); |
382 | return ops->tracing_data(event, self); | 386 | return ops->tracing_data(event, self); |
387 | case PERF_RECORD_HEADER_BUILD_ID: | ||
388 | return ops->build_id(event, self); | ||
383 | default: | 389 | default: |
384 | self->unknown_events++; | 390 | self->unknown_events++; |
385 | return -1; | 391 | return -1; |