[PATCH 3/3] trace-cmd extract: Do not delete instances after extraction

Steven Rostedt <[email protected]> Tue, 3 Feb 2026 20:14:55 -0500
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

After trace-cmd extract is finished reading an instance, it deletes that
instance. That is incorrect behavior.

Signed-off-by: Steven Rostedt (Google) <[email protected]>
---
 tracecmd/trace-record.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 1707345b343f..30727d613492 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -7454,6 +7454,9 @@ void trace_extract(int argc, char **argv)
 		/* Some instances may not be created yet */
 		if (instance->tracing_on_init_val < 0)
 			instance->tracing_on_init_val = 1;
+
+		/* Keep all instances */
+		instance->flags |= BUFFER_FL_KEEP;
 	}
 
 	/* Extracting data records all events in the system. */
-- 
2.51.0