summaryrefslogtreecommitdiff
path: root/include/linux/trace_events.h
diff options
context:
space:
mode:
authorTom Zanussi <zanussi@kernel.org>2020-01-29 12:59:22 -0600
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-01-30 09:46:28 -0500
commite3e2a2cc9c96725457ad6f31712ea7681a55666e (patch)
treef3798c12d745cde3663edacdf5c41c939db9863c /include/linux/trace_events.h
parent89c95fcef1942415e0f20d8c82e6e36ff8eeca9c (diff)
tracing: Add trace_get/put_event_file()
Add a function to get an event file and prevent it from going away on module or instance removal. trace_get_event_file() will find an event file in a given instance (if instance is NULL, it assumes the top trace array) and return it, pinning the instance's trace array as well as the event's module, if applicable, so they won't go away while in use. trace_put_event_file() does the matching release. Link: http://lkml.kernel.org/r/bb31ac4bdda168d5ed3c4b5f5a4c8f633e8d9118.1580323897.git.zanussi@kernel.org Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Tom Zanussi <zanussi@kernel.org> [ Moved trace_array_put() to end of trace_put_event_file() ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/trace_events.h')
-rw-r--r--include/linux/trace_events.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 20948ee56f8c..8d621a73c97e 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -349,6 +349,11 @@ enum {
EVENT_FILE_FL_WAS_ENABLED_BIT,
};
+extern struct trace_event_file *trace_get_event_file(const char *instance,
+ const char *system,
+ const char *event);
+extern void trace_put_event_file(struct trace_event_file *file);
+
/*
* Event file flags:
* ENABLED - The event is enabled