linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Douglas RAILLARD <douglas.raillard@arm.com>
Subject: [PATCH] trace-cmd extract: Do not extract top level unless told to
Date: Thu, 1 Jun 2023 07:50:53 -0400	[thread overview]
Message-ID: <20230601075053.3fa7dd9b@rorschach.local.home> (raw)

From: Steven Rostedt (Google) <rostedt@goodmis.org>

The trace-cmd extract man pages explicitly states that if the '-B'
option is used, it will only extract the given instance and not touch
any other buffer instance including the top level, unless '-t' is given
(for the top level) or '-a' (for all instances). But currently it is
hard coded to extract the top level. Make extract only touch what it is
told according to the documentation.

Reported-by: Douglas RAILLARD <douglas.raillard@arm.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217340
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index f852aa71..56b7991a 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -7278,7 +7278,7 @@ void trace_extract(int argc, char **argv)
 
 	type = get_trace_cmd_type(ctx.curr_cmd);
 
-	update_first_instance(ctx.instance, 1);
+	update_first_instance(ctx.instance, ctx.topt);
 	check_function_plugin();
 
 	if (!ctx.output)

                 reply	other threads:[~2023-06-01 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20230601075053.3fa7dd9b@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=douglas.raillard@arm.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).