mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
tracing: Rename event_trigger_alloc() to trigger_data_alloc()
[ Upstream commitf2947c4b7d
] The function event_trigger_alloc() creates an event_trigger_data descriptor and states that it needs to be freed via event_trigger_free(). This is incorrect, it needs to be freed by trigger_data_free() as event_trigger_free() adds ref counting. Rename event_trigger_alloc() to trigger_data_alloc() and state that it needs to be freed via trigger_data_free(). This naming convention was introducing bugs. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Tom Zanussi <zanussi@kernel.org> Link: https://lore.kernel.org/20250507145455.776436410@goodmis.org Fixes:86599dbe2c
("tracing: Add helper functions to simplify event_command.parse() callback handling") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ec913bc18b
commit
4839a4a6ab
|
@ -1731,6 +1731,9 @@ extern int event_enable_register_trigger(char *glob,
|
|||
extern void event_enable_unregister_trigger(char *glob,
|
||||
struct event_trigger_data *test,
|
||||
struct trace_event_file *file);
|
||||
extern struct event_trigger_data *
|
||||
trigger_data_alloc(struct event_command *cmd_ops, char *cmd, char *param,
|
||||
void *private_data);
|
||||
extern void trigger_data_free(struct event_trigger_data *data);
|
||||
extern int event_trigger_init(struct event_trigger_data *data);
|
||||
extern int trace_event_trigger_enable_disable(struct trace_event_file *file,
|
||||
|
@ -1757,11 +1760,6 @@ extern bool event_trigger_check_remove(const char *glob);
|
|||
extern bool event_trigger_empty_param(const char *param);
|
||||
extern int event_trigger_separate_filter(char *param_and_filter, char **param,
|
||||
char **filter, bool param_required);
|
||||
extern struct event_trigger_data *
|
||||
event_trigger_alloc(struct event_command *cmd_ops,
|
||||
char *cmd,
|
||||
char *param,
|
||||
void *private_data);
|
||||
extern int event_trigger_parse_num(char *trigger,
|
||||
struct event_trigger_data *trigger_data);
|
||||
extern int event_trigger_set_filter(struct event_command *cmd_ops,
|
||||
|
|
|
@ -6798,7 +6798,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
|
|||
return PTR_ERR(hist_data);
|
||||
}
|
||||
|
||||
trigger_data = event_trigger_alloc(cmd_ops, cmd, param, hist_data);
|
||||
trigger_data = trigger_data_alloc(cmd_ops, cmd, param, hist_data);
|
||||
if (!trigger_data) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free;
|
||||
|
|
|
@ -825,7 +825,7 @@ out:
|
|||
}
|
||||
|
||||
/**
|
||||
* event_trigger_alloc - allocate and init event_trigger_data for a trigger
|
||||
* trigger_data_alloc - allocate and init event_trigger_data for a trigger
|
||||
* @cmd_ops: The event_command operations for the trigger
|
||||
* @cmd: The cmd string
|
||||
* @param: The param string
|
||||
|
@ -836,14 +836,14 @@ out:
|
|||
* trigger_ops to assign to the event_trigger_data. @private_data can
|
||||
* also be passed in and associated with the event_trigger_data.
|
||||
*
|
||||
* Use event_trigger_free() to free an event_trigger_data object.
|
||||
* Use trigger_data_free() to free an event_trigger_data object.
|
||||
*
|
||||
* Return: The trigger_data object success, NULL otherwise
|
||||
*/
|
||||
struct event_trigger_data *event_trigger_alloc(struct event_command *cmd_ops,
|
||||
char *cmd,
|
||||
char *param,
|
||||
void *private_data)
|
||||
struct event_trigger_data *trigger_data_alloc(struct event_command *cmd_ops,
|
||||
char *cmd,
|
||||
char *param,
|
||||
void *private_data)
|
||||
{
|
||||
struct event_trigger_data *trigger_data;
|
||||
struct event_trigger_ops *trigger_ops;
|
||||
|
@ -1010,7 +1010,7 @@ event_trigger_parse(struct event_command *cmd_ops,
|
|||
return ret;
|
||||
|
||||
ret = -ENOMEM;
|
||||
trigger_data = event_trigger_alloc(cmd_ops, cmd, param, file);
|
||||
trigger_data = trigger_data_alloc(cmd_ops, cmd, param, file);
|
||||
if (!trigger_data)
|
||||
goto out;
|
||||
|
||||
|
@ -1814,7 +1814,7 @@ int event_enable_trigger_parse(struct event_command *cmd_ops,
|
|||
enable_data->enable = enable;
|
||||
enable_data->file = event_enable_file;
|
||||
|
||||
trigger_data = event_trigger_alloc(cmd_ops, cmd, param, enable_data);
|
||||
trigger_data = trigger_data_alloc(cmd_ops, cmd, param, enable_data);
|
||||
if (!trigger_data) {
|
||||
kfree(enable_data);
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue
Block a user