diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-12-07 07:48:50 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-12-09 09:09:18 -0500 |
commit | e4c2df132fef60a28b851abc1859a531e64f350c (patch) | |
tree | 19a69d8d0329dc6a69ff714cf0980f3df59b81a0 | |
parent | 9aefcab0de472ee2b3ab195a6827ddd4b170e3a7 (diff) |
perf session: Store file offset in sample_queue
Preparatory patch for ordered output of perf report -D.
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20101207124550.725128545@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/session.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 12761d5bc92a..a4339548de67 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -444,6 +444,7 @@ static event__swap_op event__swap_ops[] = { | |||
444 | 444 | ||
445 | struct sample_queue { | 445 | struct sample_queue { |
446 | u64 timestamp; | 446 | u64 timestamp; |
447 | u64 file_offset; | ||
447 | event_t *event; | 448 | event_t *event; |
448 | struct list_head list; | 449 | struct list_head list; |
449 | }; | 450 | }; |
@@ -596,7 +597,7 @@ static void __queue_event(struct sample_queue *new, struct perf_session *s) | |||
596 | #define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue)) | 597 | #define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue)) |
597 | 598 | ||
598 | static int perf_session_queue_event(struct perf_session *s, event_t *event, | 599 | static int perf_session_queue_event(struct perf_session *s, event_t *event, |
599 | struct sample_data *data) | 600 | struct sample_data *data, u64 file_offset) |
600 | { | 601 | { |
601 | struct ordered_samples *os = &s->ordered_samples; | 602 | struct ordered_samples *os = &s->ordered_samples; |
602 | struct list_head *sc = &os->sample_cache; | 603 | struct list_head *sc = &os->sample_cache; |
@@ -628,6 +629,7 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event, | |||
628 | } | 629 | } |
629 | 630 | ||
630 | new->timestamp = timestamp; | 631 | new->timestamp = timestamp; |
632 | new->file_offset = file_offset; | ||
631 | new->event = event; | 633 | new->event = event; |
632 | 634 | ||
633 | __queue_event(new, s); | 635 | __queue_event(new, s); |
@@ -780,7 +782,8 @@ static int perf_session__process_event(struct perf_session *session, | |||
780 | } | 782 | } |
781 | 783 | ||
782 | if (ops->ordered_samples) { | 784 | if (ops->ordered_samples) { |
783 | ret = perf_session_queue_event(session, event, &sample); | 785 | ret = perf_session_queue_event(session, event, &sample, |
786 | file_offset); | ||
784 | if (ret != -ETIME) | 787 | if (ret != -ETIME) |
785 | return ret; | 788 | return ret; |
786 | } | 789 | } |