]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtla: Add trace_instance_stop
authorTomas Glozar <tglozar@redhat.com>
Thu, 16 Jan 2025 14:49:27 +0000 (15:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:52 +0000 (13:49 +0100)
commit e879b5dcf8d044f3865a32d95cc5b213f314c54f upstream.

Support not only turning trace on for the timerlat tracer, but also
turning it off.

This will be used in subsequent patches to stop the timerlat tracer
without also wiping the trace buffer.

Cc: stable@vger.kernel.org
Cc: John Kacur <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/20250116144931.649593-2-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/tracing/rtla/src/trace.c
tools/tracing/rtla/src/trace.h

index e1ba6d9f4265802cd8ae59a80c73d383afcaf865..93e4032b2397afb265fc126df9d1a1bdbc8cf0d3 100644 (file)
@@ -196,6 +196,14 @@ int trace_instance_start(struct trace_instance *trace)
        return tracefs_trace_on(trace->inst);
 }
 
+/*
+ * trace_instance_stop - stop tracing a given rtla instance
+ */
+int trace_instance_stop(struct trace_instance *trace)
+{
+       return tracefs_trace_off(trace->inst);
+}
+
 /*
  * trace_events_free - free a list of trace events
  */
index 2e9a89a256150b2eb8e3d114968e356a9efe62b2..551a7cb81f636151a60473e24148f1be2487f985 100644 (file)
@@ -21,6 +21,7 @@ struct trace_instance {
 
 int trace_instance_init(struct trace_instance *trace, char *tool_name);
 int trace_instance_start(struct trace_instance *trace);
+int trace_instance_stop(struct trace_instance *trace);
 void trace_instance_destroy(struct trace_instance *trace);
 
 struct trace_seq *get_trace_seq(void);