Commit ab4bf008 authored by Tom Zanussi's avatar Tom Zanussi Committed by Steven Rostedt

tracing: Make event trigger functions available

Make various event trigger utility functions available outside of
trace_events_trigger.c so that new triggers can be defined outside of
that file.

Link: http://lkml.kernel.org/r/4a40c1695dd43cac6cd475d72e13ffe30ba84bff.1449767187.git.tom.zanussi@linux.intel.comSigned-off-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4ef56902
...@@ -1175,6 +1175,20 @@ struct event_trigger_data { ...@@ -1175,6 +1175,20 @@ struct event_trigger_data {
struct list_head list; struct list_head list;
}; };
extern void trigger_data_free(struct event_trigger_data *data);
extern int event_trigger_init(struct event_trigger_ops *ops,
struct event_trigger_data *data);
extern int trace_event_trigger_enable_disable(struct trace_event_file *file,
int trigger_enable);
extern void update_cond_flag(struct trace_event_file *file);
extern void unregister_trigger(char *glob, struct event_trigger_ops *ops,
struct event_trigger_data *test,
struct trace_event_file *file);
extern int set_trigger_filter(char *filter_str,
struct event_trigger_data *trigger_data,
struct trace_event_file *file);
extern int register_event_command(struct event_command *cmd);
/** /**
* struct event_trigger_ops - callbacks for trace event triggers * struct event_trigger_ops - callbacks for trace event triggers
* *
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
static LIST_HEAD(trigger_commands); static LIST_HEAD(trigger_commands);
static DEFINE_MUTEX(trigger_cmd_mutex); static DEFINE_MUTEX(trigger_cmd_mutex);
static void void trigger_data_free(struct event_trigger_data *data)
trigger_data_free(struct event_trigger_data *data)
{ {
if (data->cmd_ops->set_filter) if (data->cmd_ops->set_filter)
data->cmd_ops->set_filter(NULL, data, NULL); data->cmd_ops->set_filter(NULL, data, NULL);
...@@ -306,7 +305,7 @@ const struct file_operations event_trigger_fops = { ...@@ -306,7 +305,7 @@ const struct file_operations event_trigger_fops = {
* Currently we only register event commands from __init, so mark this * Currently we only register event commands from __init, so mark this
* __init too. * __init too.
*/ */
static __init int register_event_command(struct event_command *cmd) __init int register_event_command(struct event_command *cmd)
{ {
struct event_command *p; struct event_command *p;
int ret = 0; int ret = 0;
...@@ -395,9 +394,8 @@ event_trigger_print(const char *name, struct seq_file *m, ...@@ -395,9 +394,8 @@ event_trigger_print(const char *name, struct seq_file *m,
* *
* Return: 0 on success, errno otherwise * Return: 0 on success, errno otherwise
*/ */
static int int event_trigger_init(struct event_trigger_ops *ops,
event_trigger_init(struct event_trigger_ops *ops, struct event_trigger_data *data)
struct event_trigger_data *data)
{ {
data->ref++; data->ref++;
return 0; return 0;
...@@ -425,8 +423,8 @@ event_trigger_free(struct event_trigger_ops *ops, ...@@ -425,8 +423,8 @@ event_trigger_free(struct event_trigger_ops *ops,
trigger_data_free(data); trigger_data_free(data);
} }
static int trace_event_trigger_enable_disable(struct trace_event_file *file, int trace_event_trigger_enable_disable(struct trace_event_file *file,
int trigger_enable) int trigger_enable)
{ {
int ret = 0; int ret = 0;
...@@ -483,7 +481,7 @@ clear_event_triggers(struct trace_array *tr) ...@@ -483,7 +481,7 @@ clear_event_triggers(struct trace_array *tr)
* its TRIGGER_COND bit set, otherwise the TRIGGER_COND bit should be * its TRIGGER_COND bit set, otherwise the TRIGGER_COND bit should be
* cleared. * cleared.
*/ */
static void update_cond_flag(struct trace_event_file *file) void update_cond_flag(struct trace_event_file *file)
{ {
struct event_trigger_data *data; struct event_trigger_data *data;
bool set_cond = false; bool set_cond = false;
...@@ -560,9 +558,9 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops, ...@@ -560,9 +558,9 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops,
* Usually used directly as the @unreg method in event command * Usually used directly as the @unreg method in event command
* implementations. * implementations.
*/ */
static void unregister_trigger(char *glob, struct event_trigger_ops *ops, void unregister_trigger(char *glob, struct event_trigger_ops *ops,
struct event_trigger_data *test, struct event_trigger_data *test,
struct trace_event_file *file) struct trace_event_file *file)
{ {
struct event_trigger_data *data; struct event_trigger_data *data;
bool unregistered = false; bool unregistered = false;
...@@ -696,9 +694,9 @@ event_trigger_callback(struct event_command *cmd_ops, ...@@ -696,9 +694,9 @@ event_trigger_callback(struct event_command *cmd_ops,
* *
* Return: 0 on success, errno otherwise * Return: 0 on success, errno otherwise
*/ */
static int set_trigger_filter(char *filter_str, int set_trigger_filter(char *filter_str,
struct event_trigger_data *trigger_data, struct event_trigger_data *trigger_data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
struct event_trigger_data *data = trigger_data; struct event_trigger_data *data = trigger_data;
struct event_filter *filter = NULL, *tmp; struct event_filter *filter = NULL, *tmp;
......
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