tracing: Simplify assignment parsing for hist triggers
authorTom Zanussi <zanussi@kernel.org>
Fri, 28 Jun 2019 17:40:20 +0000 (12:40 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 29 Jan 2020 04:16:27 +0000 (23:16 -0500)
commitb527b638fd63ba791dc90a0a6e9a3035b10df52b
treec67dccdfd905a89ab364435840c54a462ab720cb
parentd0ce47cb993ec88d293bac7b51ba2d97ea99594c
tracing: Simplify assignment parsing for hist triggers

In the process of adding better error messages for sorting, I realized
that strsep was being used incorrectly and some of the error paths I
was expecting to be hit weren't and just fell through to the common
invalid key error case.

It also became obvious that for keyword assignments, it wasn't
necessary to save the full assignment and reparse it later, and having
a common empty-assignment check would also make more sense in terms of
error processing.

Change the code to fix these problems and simplify it for new error
message changes in a subsequent patch.

Link: http://lkml.kernel.org/r/1c3ef0b6655deaf345f6faee2584a0298ac2d743.1561743018.git.zanussi@kernel.org
Fixes: e62347d24534 ("tracing: Add hist trigger support for user-defined sorting ('sort=' param)")
Fixes: 7ef224d1d0e3 ("tracing: Add 'hist' event trigger command")
Fixes: a4072fe85ba3 ("tracing: Add a clock attribute for hist triggers")
Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c