ring_buffer_record_enable(buffer);
 }
 
+static void tracing_reset_all_cpus(struct array_buffer *buf)
+{
+       struct trace_buffer *buffer = buf->buffer;
+
+       if (!buffer)
+               return;
+
+       ring_buffer_record_disable(buffer);
+
+       /* Make sure all commits have finished */
+       synchronize_rcu();
+
+       buf->time_start = buffer_ftrace_now(buf, buf->cpu);
+
+       ring_buffer_reset(buffer);
+
+       ring_buffer_record_enable(buffer);
+}
+
 /* Must have trace_types_lock held */
 void tracing_reset_all_online_cpus_unlocked(void)
 {
        if (!tr->text_delta && !tr->data_delta)
                return;
 
-       /* Clear old data */
-       tracing_reset_online_cpus(&tr->array_buffer);
+       /*
+        * Need to clear all CPU buffers as there cannot be events
+        * from the previous boot mixed with events with this boot
+        * as that will cause a confusing trace. Need to clear all
+        * CPU buffers, even for those that may currently be offline.
+        */
+       tracing_reset_all_cpus(&tr->array_buffer);
 
        /* Using current data now */
        tr->text_delta = 0;