linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd record: Do not remove instances with -v
@ 2024-07-19  1:48 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2024-07-19  1:48 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: Jerome Marchand

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

The -v option was extended to delete instances. But this does not make sense
with the 'record' command. It only makes sense with the 'set' command.
Make sure that the 'set' command is used when deleting an instance,
otherwise it can cause adverse effects on the record side.

Link: https://lore.kernel.org/all/20240605134054.2626953-34-jmarchan@redhat.com/

Fixes: 2a3c58e75 ("trace-cmd: Extend option "-v" to delete an ftrace instance")
Reported-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 tracecmd/trace-record.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 4e9ac598..1527be11 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -6748,7 +6748,8 @@ static void parse_record_options(int argc,
 			ctx->instance = allocate_instance(optarg);
 			if (!ctx->instance)
 				die("Failed to create instance");
-			ctx->instance->delete = negative;
+			if (IS_CMDSET(ctx))
+				ctx->instance->delete = negative;
 			negative = 0;
 			if (ctx->instance->delete) {
 				ctx->instance->next = del_list;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-19  1:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19  1:48 [PATCH] trace-cmd record: Do not remove instances with -v Steven Rostedt

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