mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
tracing: Report wrong dynamic event command
Report wrong dynamic event type in the command via error_log.
-----
# echo "z hoge" > /sys/kernel/tracing/dynamic_events
sh: write error: Invalid argument
# cat /sys/kernel/tracing/error_log
[ 22.977022] dynevent: error: No matching dynamic event type
Command: z hoge
^
-----
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/176278970056.343441.10528135217342926645.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
3a0d5bc76f
commit
7157062bb4
|
|
@ -144,9 +144,16 @@ static int create_dyn_event(const char *raw_command)
|
|||
if (!ret || ret != -ECANCELED)
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&dyn_event_ops_mutex);
|
||||
if (ret == -ECANCELED)
|
||||
if (ret == -ECANCELED) {
|
||||
static const char *err_msg[] = {"No matching dynamic event type"};
|
||||
|
||||
/* Wrong dynamic event. Leave an error message. */
|
||||
tracing_log_err(NULL, "dynevent", raw_command, err_msg,
|
||||
0, 0);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
mutex_unlock(&dyn_event_ops_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user