Commit e4c2df13 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Arnaldo Carvalho de Melo

perf session: Store file offset in sample_queue

Preparatory patch for ordered output of perf report -D.
Acked-by: default avatarIan 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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9aefcab0
...@@ -444,6 +444,7 @@ static event__swap_op event__swap_ops[] = { ...@@ -444,6 +444,7 @@ static event__swap_op event__swap_ops[] = {
struct sample_queue { struct sample_queue {
u64 timestamp; u64 timestamp;
u64 file_offset;
event_t *event; event_t *event;
struct list_head list; struct list_head list;
}; };
...@@ -596,7 +597,7 @@ static void __queue_event(struct sample_queue *new, struct perf_session *s) ...@@ -596,7 +597,7 @@ static void __queue_event(struct sample_queue *new, struct perf_session *s)
#define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue)) #define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue))
static int perf_session_queue_event(struct perf_session *s, event_t *event, static int perf_session_queue_event(struct perf_session *s, event_t *event,
struct sample_data *data) struct sample_data *data, u64 file_offset)
{ {
struct ordered_samples *os = &s->ordered_samples; struct ordered_samples *os = &s->ordered_samples;
struct list_head *sc = &os->sample_cache; 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,6 +629,7 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event,
} }
new->timestamp = timestamp; new->timestamp = timestamp;
new->file_offset = file_offset;
new->event = event; new->event = event;
__queue_event(new, s); __queue_event(new, s);
...@@ -780,7 +782,8 @@ static int perf_session__process_event(struct perf_session *session, ...@@ -780,7 +782,8 @@ static int perf_session__process_event(struct perf_session *session,
} }
if (ops->ordered_samples) { if (ops->ordered_samples) {
ret = perf_session_queue_event(session, event, &sample); ret = perf_session_queue_event(session, event, &sample,
file_offset);
if (ret != -ETIME) if (ret != -ETIME)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment