Linux-Trace-Devel Archive on
 help / color / Atom feed
Cc: Vincent Donnefort <>
Subject: [PATCH] trace-cmd: fix extract output option
Date: Tue, 29 Sep 2020 18:49:26 +0100
Message-ID: <> (raw)

From: Vincent Donnefort <>

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 <>

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)

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 17:49 vincent.donnefort [this message]
2020-09-29 20:31 ` Steven Rostedt
2020-09-30  8:31   ` Vincent Donnefort

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Trace-Devel Archive on

Archives are clonable:
	git clone --mirror linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ \
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone