linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: fix extract output option
@ 2020-09-29 17:49 vincent.donnefort
  2020-09-29 20:31 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: vincent.donnefort @ 2020-09-29 17:49 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Vincent Donnefort

From: Vincent Donnefort <vincent.donnefort@arm.com>

During the introduction of instance's output_file copy:

  3a206ca ("trace-cmd: Have instances include a copy of its output file")

The extract path has been omitted, leading to a broken output option:

  $ trace-cmd extract -o /foo/bar.dat # Will fallback to ./trace.dat

Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index bd00457..72a5c8c 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -6622,6 +6622,9 @@ void trace_extract(int argc, char **argv)
 
 	/* Save the state of tracing_on before starting */
 	for_all_instances(instance) {
+		instance->output_file = strdup(ctx.output);
+		if (!instance->output_file)
+			die("Failed to allocate output file name for instance");
 
 		if (!ctx.manual && instance->flags & BUFFER_FL_PROFILE)
 			enable_profile(ctx.instance);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-30  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 17:49 [PATCH] trace-cmd: fix extract output option vincent.donnefort
2020-09-29 20:31 ` Steven Rostedt
2020-09-30  8:31   ` Vincent Donnefort

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).