trace-cmd record/extract: Do not destroy existing instances
PATCH 1/1 trace-cmd record/extract: Do not destroy existing instances
From: "Steven Rostedt (Google)" <[email protected]>
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) <[email protected]>
--- tracecmd/trace-record.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tracecmd/trace-record.c +4 -2
@@ -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); }
Signature · 1 line
2.39.2