From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd record/extract: Do not destroy existing instances
Date: Thu, 1 Jun 2023 08:28:36 -0400 [thread overview]
Message-ID: <20230601082836.2fc2eb1b@rorschach.local.home> (raw)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Do not destroy an instance that already exists when trace-cmd record or
extract is executed. There may be state that the user still would like to
know about the instance. When doing an extract, it should not delete the
instance when it is finished.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
tracecmd/trace-record.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 32fbfef58c26..ded9ea1a04e2 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -5295,7 +5295,8 @@ void tracecmd_remove_instances(void)
close(instance->tracing_on_fd);
instance->tracing_on_fd = 0;
}
- tracefs_instance_destroy(instance->tracefs);
+ if (tracefs_instance_is_new(instance->tracefs))
+ tracefs_instance_destroy(instance->tracefs);
}
}
@@ -6055,7 +6056,8 @@ static inline void remove_instances(struct buffer_instance *instances)
del = instances;
instances = instances->next;
free(del->name);
- tracefs_instance_destroy(del->tracefs);
+ if (tracefs_instance_is_new(del->tracefs))
+ tracefs_instance_destroy(del->tracefs);
tracefs_instance_free(del->tracefs);
free(del);
}
--
2.39.2
reply other threads:[~2023-06-01 12:28 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=20230601082836.2fc2eb1b@rorschach.local.home \
--to=rostedt@goodmis.org \
--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).