Skip to content

Commit a785736

Browse files
committed
tracing: Have trigger filter parsing errors show up in error_log
It is annoying that the filter parsing of triggers do not show up in the error_log. Trying to figure out what is incorrect in the input is difficult when it fails for a typo. Have the errors of filter parsing show up in error_log as well. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Tom Zanussi <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 3e12758 commit a785736

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,14 @@ int set_trigger_filter(char *filter_str,
10671067

10681068
/* The filter is for the 'trigger' event, not the triggered event */
10691069
ret = create_event_filter(file->tr, file->event_call,
1070-
filter_str, false, &filter);
1070+
filter_str, true, &filter);
1071+
1072+
/* Only enabled set_str for error handling */
1073+
if (filter) {
1074+
kfree(filter->filter_string);
1075+
filter->filter_string = NULL;
1076+
}
1077+
10711078
/*
10721079
* If create_event_filter() fails, filter still needs to be freed.
10731080
* Which the calling code will do with data->filter.

0 commit comments

Comments
 (0)