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

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.org



Signed-off-by: default avatarTom Zanussi <zanussi@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent fb339e53
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1582,11 +1582,9 @@ extern int event_enable_trigger_parse(struct event_command *cmd_ops,
				      struct trace_event_file *file,
				      char *glob, char *cmd, char *param);
extern int event_enable_register_trigger(char *glob,
					 struct event_trigger_ops *ops,
					 struct event_trigger_data *data,
					 struct trace_event_file *file);
extern void event_enable_unregister_trigger(char *glob,
					    struct event_trigger_ops *ops,
					    struct event_trigger_data *test,
					    struct trace_event_file *file);
extern void trigger_data_free(struct event_trigger_data *data);
@@ -1763,11 +1761,9 @@ struct event_command {
					 char *glob, char *cmd,
					 char *param_and_filter);
	int			(*reg)(char *glob,
				       struct event_trigger_ops *ops,
				       struct event_trigger_data *data,
				       struct trace_event_file *file);
	void			(*unreg)(char *glob,
					 struct event_trigger_ops *ops,
					 struct event_trigger_data *data,
					 struct trace_event_file *file);
	void			(*unreg_all)(struct trace_event_file *file);
+6 −6
Original line number Diff line number Diff line
@@ -556,14 +556,14 @@ static int eprobe_trigger_cmd_parse(struct event_command *cmd_ops,
	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 trace_event_file *file)
{
	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 trace_event_file *file)
{
+5 −5
Original line number Diff line number Diff line
@@ -5910,7 +5910,7 @@ static bool hist_trigger_match(struct event_trigger_data *data,
	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 trace_event_file *file)
{
@@ -6062,7 +6062,7 @@ static bool hist_trigger_check_refs(struct event_trigger_data *data,
	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 trace_event_file *file)
{
@@ -6262,7 +6262,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
			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 = find_synth_event(se_name);
		if (se)
@@ -6271,7 +6271,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
		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,
	 * 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,

	return ret;
 out_unreg:
	cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file);
	cmd_ops->unreg(glob+1, trigger_data, file);
 out_free:
	if (cmd_ops->set_filter)
		cmd_ops->set_filter(NULL, trigger_data, NULL);
+9 −13
Original line number Diff line number Diff line
@@ -540,7 +540,6 @@ void update_cond_flag(struct trace_event_file *file)
/**
 * register_trigger - Generic event_command @reg implementation
 * @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
 * @file: The trace_event_file associated with the event
 *
@@ -551,7 +550,7 @@ void update_cond_flag(struct trace_event_file *file)
 *
 * 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 trace_event_file *file)
{
@@ -589,7 +588,6 @@ static int register_trigger(char *glob, struct event_trigger_ops *ops,
/**
 * unregister_trigger - Generic event_command @unreg implementation
 * @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
 * @file: The trace_event_file associated with the event
 *
@@ -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
 * implementations.
 */
static void unregister_trigger(char *glob, struct event_trigger_ops *ops,
static void unregister_trigger(char *glob,
			       struct event_trigger_data *test,
			       struct trace_event_file *file)
{
@@ -673,7 +671,7 @@ event_trigger_parse(struct event_command *cmd_ops,
	INIT_LIST_HEAD(&trigger_data->named_list);

	if (glob[0] == '!') {
		cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file);
		cmd_ops->unreg(glob+1, trigger_data, file);
		kfree(trigger_data);
		ret = 0;
		goto out;
@@ -708,14 +706,14 @@ event_trigger_parse(struct event_command *cmd_ops,
 out_reg:
	/* Up the trigger_data count to make sure reg doesn't free it on failure */
	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,
	 * but if it didn't find any functions it returns zero.
	 * Consider no functions a failure too.
	 */
	if (!ret) {
		cmd_ops->unreg(glob, trigger_ops, trigger_data, file);
		cmd_ops->unreg(glob, trigger_data, file);
		ret = -ENOENT;
	} else if (ret > 0)
		ret = 0;
@@ -1116,14 +1114,14 @@ snapshot_count_trigger(struct event_trigger_data *data,
}

static int
register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
register_snapshot_trigger(char *glob,
			  struct event_trigger_data *data,
			  struct trace_event_file *file)
{
	if (tracing_alloc_snapshot_instance(file->tr) != 0)
		return 0;

	return register_trigger(glob, ops, data, file);
	return register_trigger(glob, data, file);
}

static int
@@ -1455,7 +1453,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
	trigger_data->private_data = enable_data;

	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(enable_data);
		ret = 0;
@@ -1502,7 +1500,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
	ret = trace_event_enable_disable(event_enable_file, 1, 1);
	if (ret < 0)
		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,
	 * 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,
}

int event_enable_register_trigger(char *glob,
				  struct event_trigger_ops *ops,
				  struct event_trigger_data *data,
				  struct trace_event_file *file)
{
@@ -1574,7 +1571,6 @@ int event_enable_register_trigger(char *glob,
}

void event_enable_unregister_trigger(char *glob,
				     struct event_trigger_ops *ops,
				     struct event_trigger_data *test,
				     struct trace_event_file *file)
{