Commit 2378a2d6 authored by Tom Zanussi's avatar Tom Zanussi Committed by Steven Rostedt

tracing: Remove ops param from event_command reg()/unreg() callbacks

The event_trigger_ops for an event_command are already accessible via
event_trigger_data.ops so remove the redundant ops from the callback.

Link: https://lkml.kernel.org/r/4c6f2a41820452f9cacddc7634ad442928aa2aa6.1641823001.git.zanussi@kernel.orgSigned-off-by: default avatarTom Zanussi <zanussi@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent fb339e53
...@@ -1582,11 +1582,9 @@ extern int event_enable_trigger_parse(struct event_command *cmd_ops, ...@@ -1582,11 +1582,9 @@ extern int event_enable_trigger_parse(struct event_command *cmd_ops,
struct trace_event_file *file, struct trace_event_file *file,
char *glob, char *cmd, char *param); char *glob, char *cmd, char *param);
extern int event_enable_register_trigger(char *glob, extern int event_enable_register_trigger(char *glob,
struct event_trigger_ops *ops,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file); struct trace_event_file *file);
extern void event_enable_unregister_trigger(char *glob, extern void event_enable_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);
extern void trigger_data_free(struct event_trigger_data *data); extern void trigger_data_free(struct event_trigger_data *data);
...@@ -1763,11 +1761,9 @@ struct event_command { ...@@ -1763,11 +1761,9 @@ struct event_command {
char *glob, char *cmd, char *glob, char *cmd,
char *param_and_filter); char *param_and_filter);
int (*reg)(char *glob, int (*reg)(char *glob,
struct event_trigger_ops *ops,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file); struct trace_event_file *file);
void (*unreg)(char *glob, void (*unreg)(char *glob,
struct event_trigger_ops *ops,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file); struct trace_event_file *file);
void (*unreg_all)(struct trace_event_file *file); void (*unreg_all)(struct trace_event_file *file);
......
...@@ -556,16 +556,16 @@ static int eprobe_trigger_cmd_parse(struct event_command *cmd_ops, ...@@ -556,16 +556,16 @@ static int eprobe_trigger_cmd_parse(struct event_command *cmd_ops,
return -1; return -1;
} }
static int eprobe_trigger_reg_func(char *glob, struct event_trigger_ops *ops, static int eprobe_trigger_reg_func(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
return -1; return -1;
} }
static void eprobe_trigger_unreg_func(char *glob, struct event_trigger_ops *ops, static void eprobe_trigger_unreg_func(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
} }
......
...@@ -5910,7 +5910,7 @@ static bool hist_trigger_match(struct event_trigger_data *data, ...@@ -5910,7 +5910,7 @@ static bool hist_trigger_match(struct event_trigger_data *data,
return true; return true;
} }
static int hist_register_trigger(char *glob, struct event_trigger_ops *ops, static int hist_register_trigger(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
...@@ -6062,7 +6062,7 @@ static bool hist_trigger_check_refs(struct event_trigger_data *data, ...@@ -6062,7 +6062,7 @@ static bool hist_trigger_check_refs(struct event_trigger_data *data,
return false; return false;
} }
static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops, static void hist_unregister_trigger(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
...@@ -6262,7 +6262,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, ...@@ -6262,7 +6262,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
goto out_free; goto out_free;
} }
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); cmd_ops->unreg(glob+1, trigger_data, file);
se_name = trace_event_name(file->event_call); se_name = trace_event_name(file->event_call);
se = find_synth_event(se_name); se = find_synth_event(se_name);
if (se) if (se)
...@@ -6271,7 +6271,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, ...@@ -6271,7 +6271,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
goto out_free; goto out_free;
} }
ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); ret = cmd_ops->reg(glob, trigger_data, file);
/* /*
* The above returns on success the # of triggers registered, * The above returns on success the # of triggers registered,
* but if it didn't register any it returns zero. Consider no * but if it didn't register any it returns zero. Consider no
...@@ -6314,7 +6314,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, ...@@ -6314,7 +6314,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
return ret; return ret;
out_unreg: out_unreg:
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); cmd_ops->unreg(glob+1, trigger_data, file);
out_free: out_free:
if (cmd_ops->set_filter) if (cmd_ops->set_filter)
cmd_ops->set_filter(NULL, trigger_data, NULL); cmd_ops->set_filter(NULL, trigger_data, NULL);
......
...@@ -540,7 +540,6 @@ void update_cond_flag(struct trace_event_file *file) ...@@ -540,7 +540,6 @@ void update_cond_flag(struct trace_event_file *file)
/** /**
* register_trigger - Generic event_command @reg implementation * register_trigger - Generic event_command @reg implementation
* @glob: The raw string used to register the trigger * @glob: The raw string used to register the trigger
* @ops: The trigger ops associated with the trigger
* @data: Trigger-specific data to associate with the trigger * @data: Trigger-specific data to associate with the trigger
* @file: The trace_event_file associated with the event * @file: The trace_event_file associated with the event
* *
...@@ -551,7 +550,7 @@ void update_cond_flag(struct trace_event_file *file) ...@@ -551,7 +550,7 @@ void update_cond_flag(struct trace_event_file *file)
* *
* Return: 0 on success, errno otherwise * Return: 0 on success, errno otherwise
*/ */
static int register_trigger(char *glob, struct event_trigger_ops *ops, static int register_trigger(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
...@@ -589,7 +588,6 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops, ...@@ -589,7 +588,6 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops,
/** /**
* unregister_trigger - Generic event_command @unreg implementation * unregister_trigger - Generic event_command @unreg implementation
* @glob: The raw string used to register the trigger * @glob: The raw string used to register the trigger
* @ops: The trigger ops associated with the trigger
* @test: Trigger-specific data used to find the trigger to remove * @test: Trigger-specific data used to find the trigger to remove
* @file: The trace_event_file associated with the event * @file: The trace_event_file associated with the event
* *
...@@ -598,7 +596,7 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops, ...@@ -598,7 +596,7 @@ 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, static void unregister_trigger(char *glob,
struct event_trigger_data *test, struct event_trigger_data *test,
struct trace_event_file *file) struct trace_event_file *file)
{ {
...@@ -673,7 +671,7 @@ event_trigger_parse(struct event_command *cmd_ops, ...@@ -673,7 +671,7 @@ event_trigger_parse(struct event_command *cmd_ops,
INIT_LIST_HEAD(&trigger_data->named_list); INIT_LIST_HEAD(&trigger_data->named_list);
if (glob[0] == '!') { if (glob[0] == '!') {
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); cmd_ops->unreg(glob+1, trigger_data, file);
kfree(trigger_data); kfree(trigger_data);
ret = 0; ret = 0;
goto out; goto out;
...@@ -708,14 +706,14 @@ event_trigger_parse(struct event_command *cmd_ops, ...@@ -708,14 +706,14 @@ event_trigger_parse(struct event_command *cmd_ops,
out_reg: out_reg:
/* Up the trigger_data count to make sure reg doesn't free it on failure */ /* Up the trigger_data count to make sure reg doesn't free it on failure */
event_trigger_init(trigger_ops, trigger_data); event_trigger_init(trigger_ops, trigger_data);
ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); ret = cmd_ops->reg(glob, trigger_data, file);
/* /*
* The above returns on success the # of functions enabled, * The above returns on success the # of functions enabled,
* but if it didn't find any functions it returns zero. * but if it didn't find any functions it returns zero.
* Consider no functions a failure too. * Consider no functions a failure too.
*/ */
if (!ret) { if (!ret) {
cmd_ops->unreg(glob, trigger_ops, trigger_data, file); cmd_ops->unreg(glob, trigger_data, file);
ret = -ENOENT; ret = -ENOENT;
} else if (ret > 0) } else if (ret > 0)
ret = 0; ret = 0;
...@@ -1116,14 +1114,14 @@ snapshot_count_trigger(struct event_trigger_data *data, ...@@ -1116,14 +1114,14 @@ snapshot_count_trigger(struct event_trigger_data *data,
} }
static int static int
register_snapshot_trigger(char *glob, struct event_trigger_ops *ops, register_snapshot_trigger(char *glob,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
if (tracing_alloc_snapshot_instance(file->tr) != 0) if (tracing_alloc_snapshot_instance(file->tr) != 0)
return 0; return 0;
return register_trigger(glob, ops, data, file); return register_trigger(glob, data, file);
} }
static int static int
...@@ -1455,7 +1453,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops, ...@@ -1455,7 +1453,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
trigger_data->private_data = enable_data; trigger_data->private_data = enable_data;
if (glob[0] == '!') { if (glob[0] == '!') {
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file); cmd_ops->unreg(glob+1, trigger_data, file);
kfree(trigger_data); kfree(trigger_data);
kfree(enable_data); kfree(enable_data);
ret = 0; ret = 0;
...@@ -1502,7 +1500,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops, ...@@ -1502,7 +1500,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
ret = trace_event_enable_disable(event_enable_file, 1, 1); ret = trace_event_enable_disable(event_enable_file, 1, 1);
if (ret < 0) if (ret < 0)
goto out_put; goto out_put;
ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); ret = cmd_ops->reg(glob, trigger_data, file);
/* /*
* The above returns on success the # of functions enabled, * The above returns on success the # of functions enabled,
* but if it didn't find any functions it returns zero. * but if it didn't find any functions it returns zero.
...@@ -1532,7 +1530,6 @@ int event_enable_trigger_parse(struct event_command *cmd_ops, ...@@ -1532,7 +1530,6 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
} }
int event_enable_register_trigger(char *glob, int event_enable_register_trigger(char *glob,
struct event_trigger_ops *ops,
struct event_trigger_data *data, struct event_trigger_data *data,
struct trace_event_file *file) struct trace_event_file *file)
{ {
...@@ -1574,7 +1571,6 @@ int event_enable_register_trigger(char *glob, ...@@ -1574,7 +1571,6 @@ int event_enable_register_trigger(char *glob,
} }
void event_enable_unregister_trigger(char *glob, void event_enable_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)
{ {
......
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