OSDN Git Service

tracing: Clean up and document pred_funcs_##type creation and use
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 8 Mar 2018 22:53:20 +0000 (17:53 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 14 Mar 2018 16:35:20 +0000 (12:35 -0400)
commit478325f188657d0e503d1f88cdaf516c792352c5
tree503038508e70f74c34059ef50eb7d14c7e9b9ecd
parente9baef0d86162add1205eb07bae08e9efc2f1ae0
tracing: Clean up and document pred_funcs_##type creation and use

The pred_funcs_##type arrays consist of five functions that are assigned
based on the ops. The array must be in the same order of the ops each
function represents. The PRED_FUNC_START macro denotes the op enum that
starts the op that maps to the pred_funcs_##type arrays. This is all very
subtle and prone to bugs if the code is changed.

Add comments describing how PRED_FUNC_START and pred_funcs_##type array is
used, and also a PRED_FUNC_MAX that is the maximum number of functions in
the arrays.

Clean up select_comparison_fn() that assigns the predicates to the
pred_funcs_##type array function as well as add protection in case an op is
passed in that does not map correctly to the array.

Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_filter.c