diff mbox series

[1/9,v2] trace-cmd restore: Fix to add saved cmdlines after calling tracecmd_create_init_file_override()

Message ID 20210305225947.378797358@goodmis.org (mailing list archive)
State Accepted
Commit 2cdf955d0bcb9986fb549bdb3682696f67522042
Headers show
Series trace-cmd: Fixes for trace-cmd restore | expand

Commit Message

Steven Rostedt March 5, 2021, 10:52 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The saving of command lines was moved out of the create_file() logic to
capture them after the tracing has finished. But this broke trace-cmd
restore as it expected them to be saved by the
tracecmd_create_init_file_override() function.

Link: https://lore.kernel.org/linux-trace-devel/20210301143856.788923617@goodmis.org

Fixes: 1eea02a4b ("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tracecmd/trace-restore.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tracecmd/trace-restore.c b/tracecmd/trace-restore.c
index 98e757337a03..13f803053582 100644
--- a/tracecmd/trace-restore.c
+++ b/tracecmd/trace-restore.c
@@ -94,6 +94,8 @@  void trace_restore (int argc, char **argv)
 							    kallsyms);
 		if (!handle)
 			die("Unabled to create output file %s", output);
+		if (tracecmd_write_cmdlines(handle) < 0)
+			die("Failed to write command lines");
 		tracecmd_output_close(handle);
 		exit(0);
 	}