projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60efc15
)
tracing: Reset ring buffer when changing trace_clocks
author
David Sharp
<
[email protected]
>
Thu, 11 Oct 2012 23:27:52 +0000
(16:27 -0700)
committer
Steven Rostedt
<
[email protected]
>
Fri, 2 Nov 2012 14:21:47 +0000
(10:21 -0400)
Because the "tsc" clock isn't in nanoseconds, the ring buffer must be
reset when changing clocks so that incomparable timestamps don't end up
in the same trace.
Tested: Confirmed switching clocks resets the trace buffer.
Google-Bug-Id:
6980623
Link:
http://lkml.kernel.org/r/
[email protected]
Cc: Masami Hiramatsu <
[email protected]
>
Signed-off-by: David Sharp <
[email protected]
>
Signed-off-by: Steven Rostedt <
[email protected]
>
kernel/trace/trace.c
patch
|
blob
|
history
diff --git
a/kernel/trace/trace.c
b/kernel/trace/trace.c
index 88111b08b2c1d6885c703d3322b274ba425b4db3..6ed6013dff2b45052068f44c92496dcc62ec32a9 100644
(file)
--- a/
kernel/trace/trace.c
+++ b/
kernel/trace/trace.c
@@
-4073,6
+4073,14
@@
static ssize_t tracing_clock_write(struct file *filp, const char __user *ubuf,
if (max_tr.buffer)
ring_buffer_set_clock(max_tr.buffer, trace_clocks[i].func);
+ /*
+ * New clock may not be consistent with the previous clock.
+ * Reset the buffer so that it doesn't have incomparable timestamps.
+ */
+ tracing_reset_online_cpus(&global_trace);
+ if (max_tr.buffer)
+ tracing_reset_online_cpus(&max_tr);
+
mutex_unlock(&trace_types_lock);
*fpos += cnt;