diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-26 12:47:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-26 12:44:06 -0500 |
commit | 14131f2f98ac350ee9e73faed916d2238a8b6a0d (patch) | |
tree | bf490d104276142e914f1245bbc9f44cb0d2bc9b /kernel/trace/ring_buffer.c | |
parent | 6409c4da289d6905f7ae2bd0630438368439bda2 (diff) |
tracing: implement trace_clock_*() APIs
Impact: implement new tracing timestamp APIs
Add three trace clock variants, with differing scalability/precision
tradeoffs:
- local: CPU-local trace clock
- medium: scalable global clock with some jitter
- global: globally monotonic, serialized clock
Make the ring-buffer use the local trace clock internally.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 8f19f1aa42b0..a8c275c01e83 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 2008 Steven Rostedt <srostedt@redhat.com> | 4 | * Copyright (C) 2008 Steven Rostedt <srostedt@redhat.com> |
5 | */ | 5 | */ |
6 | #include <linux/ring_buffer.h> | 6 | #include <linux/ring_buffer.h> |
7 | #include <linux/trace_clock.h> | ||
7 | #include <linux/ftrace_irq.h> | 8 | #include <linux/ftrace_irq.h> |
8 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
9 | #include <linux/debugfs.h> | 10 | #include <linux/debugfs.h> |
@@ -12,7 +13,6 @@ | |||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/percpu.h> | 14 | #include <linux/percpu.h> |
14 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
15 | #include <linux/sched.h> /* used for sched_clock() (for now) */ | ||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/hash.h> | 17 | #include <linux/hash.h> |
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
@@ -112,14 +112,13 @@ EXPORT_SYMBOL_GPL(tracing_is_on); | |||
112 | /* Up this if you want to test the TIME_EXTENTS and normalization */ | 112 | /* Up this if you want to test the TIME_EXTENTS and normalization */ |
113 | #define DEBUG_SHIFT 0 | 113 | #define DEBUG_SHIFT 0 |
114 | 114 | ||
115 | /* FIXME!!! */ | ||
116 | u64 ring_buffer_time_stamp(int cpu) | 115 | u64 ring_buffer_time_stamp(int cpu) |
117 | { | 116 | { |
118 | u64 time; | 117 | u64 time; |
119 | 118 | ||
120 | preempt_disable_notrace(); | 119 | preempt_disable_notrace(); |
121 | /* shift to debug/test normalization and TIME_EXTENTS */ | 120 | /* shift to debug/test normalization and TIME_EXTENTS */ |
122 | time = sched_clock() << DEBUG_SHIFT; | 121 | time = trace_clock_local() << DEBUG_SHIFT; |
123 | preempt_enable_no_resched_notrace(); | 122 | preempt_enable_no_resched_notrace(); |
124 | 123 | ||
125 | return time; | 124 | return time; |