return 0;
}
- * trace_clear() - clear accumulated traced data
+ /**
+ * trace_init() - initialize the tracing system and enable it
+ *
+ * @buff: Pointer to trace buffer
+ * @buff_size: Size of trace buffer
+ * Return: 0 if ok
+ */
+ int notrace trace_init(void *buff, size_t buff_size)
+ {
+ /* If traces are enabled already, we may have early traces to copy */
+ return trace_init_(buff, buff_size, trace_enabled, true);
+ }
+
+ /**
-int notrace trace_clear(void)
++ * trace_wipe() - clear accumulated traced data
+ *
+ * May be called with tracing enabled or disabled.
+ */
++int notrace trace_wipe(void)
+ {
+ bool was_enabled = trace_enabled;
+
+ if (trace_enabled)
+ trace_enabled = 0;
+ return trace_init_(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE,
+ false, was_enabled);
+ }
+
#ifdef CONFIG_TRACE_EARLY
/**
* trace_early_init() - initialize the tracing system for early tracing