diff mbox series

trace-cmd library: Write buffer option in out_write_cpu_data()

Message ID 20220404112031.61506913@gandalf.local.home (mailing list archive)
State Accepted
Commit 2efc9575a663ed10ef83d12fe96870c04042de91
Headers show
Series trace-cmd library: Write buffer option in out_write_cpu_data() | expand

Commit Message

Steven Rostedt April 4, 2022, 3:20 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

When putting together the tracing files for trace-cmd restore, the call to
out_write_cpu_data() does not write the final options that added the
buffer data, and it is not able to be read.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 lib/trace-cmd/trace-output.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index f3a203ec347f..ca7132e113c0 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -2526,6 +2526,9 @@  __hidden int out_write_cpu_data(struct tracecmd_output *handle,
 
 	handle->file_state = TRACECMD_FILE_CPU_FLYRECORD;
 
+	if (HAS_SECTIONS(handle))
+		tracecmd_write_options(handle);
+
 	return 0;
 
  out_free: