]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - tools/lib/traceevent/trace-seq.c
tools lib traceevent: Add trace_seq_reset()
[karo-tx-linux.git] / tools / lib / traceevent / trace-seq.c
index a57db805136a2c205c6284d65045c2cbd5ee471d..d7f2e68bc5b91d190e2ad5cd34388b45d957372a 100644 (file)
@@ -48,6 +48,19 @@ void trace_seq_init(struct trace_seq *s)
        s->buffer = malloc_or_die(s->buffer_size);
 }
 
+/**
+ * trace_seq_reset - re-initialize the trace_seq structure
+ * @s: a pointer to the trace_seq structure to reset
+ */
+void trace_seq_reset(struct trace_seq *s)
+{
+       if (!s)
+               return;
+       TRACE_SEQ_CHECK(s);
+       s->len = 0;
+       s->readpos = 0;
+}
+
 /**
  * trace_seq_destroy - free up memory of a trace_seq
  * @s: a pointer to the trace_seq to free the buffer