All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace-cmd record/extract: Do not destroy existing instances
@ 2023-06-01 12:28 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2023-06-01 12:28 UTC (permalink / raw)
  To: Linux Trace Devel

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


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

only message in thread, other threads:[~2023-06-01 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01 12:28 [PATCH] trace-cmd record/extract: Do not destroy existing instances Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.