|
@@ -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;
|