Commit 4671c794 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

tracing: add trace_set_clr_event to export event enabling function

Other parts of the kernel may need to be able to enable or disable
specific events. Especially parts that create trace events.

[ Impact: allow enabling of trace events by those that create the event ]
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 29f93943
...@@ -127,6 +127,8 @@ extern int trace_define_field(struct ftrace_event_call *call, char *type, ...@@ -127,6 +127,8 @@ extern int trace_define_field(struct ftrace_event_call *call, char *type,
#define is_signed_type(type) (((type)(-1)) < 0) #define is_signed_type(type) (((type)(-1)) < 0)
int trace_set_clr_event(const char *system, const char *event, int set);
/* /*
* The double __builtin_constant_p is because gcc will give us an error * The double __builtin_constant_p is because gcc will give us an error
* if we try to allocate the static variable to fmt if it is not a * if we try to allocate the static variable to fmt if it is not a
......
...@@ -177,6 +177,23 @@ static int ftrace_set_clr_event(char *buf, int set) ...@@ -177,6 +177,23 @@ static int ftrace_set_clr_event(char *buf, int set)
return __ftrace_set_clr_event(match, sub, event, set); return __ftrace_set_clr_event(match, sub, event, set);
} }
/**
* trace_set_clr_event - enable or disable an event
* @system: system name to match (NULL for any system)
* @event: event name to match (NULL for all events, within system)
* @set: 1 to enable, 0 to disable
*
* This is a way for other parts of the kernel to enable or disable
* event recording.
*
* Returns 0 on success, -EINVAL if the parameters do not match any
* registered events.
*/
int trace_set_clr_event(const char *system, const char *event, int set)
{
return __ftrace_set_clr_event(NULL, system, event, set);
}
/* 128 should be much more than enough */ /* 128 should be much more than enough */
#define EVENT_BUF_SIZE 127 #define EVENT_BUF_SIZE 127
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment