diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2009-09-12 07:52:47 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-19 11:42:10 +0200 |
commit | 393b2ad8c757ba3ccd2a99ca5bbcd6db4d3fa53d (patch) | |
tree | 8972e2e9647c814e71be74d37adb85b18e9c6732 /kernel | |
parent | 929bf0d0156562ce631728b6fa53d68004d456d2 (diff) | |
download | linux-393b2ad8c757ba3ccd2a99ca5bbcd6db4d3fa53d.tar.gz linux-393b2ad8c757ba3ccd2a99ca5bbcd6db4d3fa53d.tar.bz2 linux-393b2ad8c757ba3ccd2a99ca5bbcd6db4d3fa53d.zip |
perf: Add a timestamp to fork events
perf timechart needs to know when a process forked, in order to be
able to visualize properly when tasks start.
This patch adds a time field to the event structure, and fills it
in appropriately.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090912130341.51ad2de2@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/perf_counter.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index d013f4e89e9c..d5899b62b276 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -3083,6 +3083,7 @@ struct perf_task_event { u32 ppid; u32 tid; u32 ptid; + u64 time; } event; }; @@ -3090,9 +3091,12 @@ static void perf_counter_task_output(struct perf_counter *counter, struct perf_task_event *task_event) { struct perf_output_handle handle; - int size = task_event->event.header.size; + int size; struct task_struct *task = task_event->task; - int ret = perf_output_begin(&handle, counter, size, 0, 0); + int ret; + + size = task_event->event.header.size; + ret = perf_output_begin(&handle, counter, size, 0, 0); if (ret) return; @@ -3103,7 +3107,10 @@ static void perf_counter_task_output(struct perf_counter *counter, task_event->event.tid = perf_counter_tid(counter, task); task_event->event.ptid = perf_counter_tid(counter, current); + task_event->event.time = perf_clock(); + perf_output_put(&handle, task_event->event); + perf_output_end(&handle); } |