1. 14 Mar, 2018 2 commits
    • Steven Rostedt (VMware)'s avatar
      tracing: Clean up and document pred_funcs_##type creation and use · 478325f1
      Steven Rostedt (VMware) authored
      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: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      478325f1
    • Steven Rostedt (VMware)'s avatar
      tracing: Combine enum and arrays into single macro in filter code · e9baef0d
      Steven Rostedt (VMware) authored
      Instead of having a separate enum that is the index into another array, like
      a string array, make a single macro that combines them into a single list,
      and then the two can not get out of sync. This makes it easier to add and
      remove items.
      
      The macro trick is:
      
       #define DOGS				\
        C( JACK,     "Jack Russell")		\
        C( ITALIAN,  "Italian Greyhound")	\
        C( GERMAN,   "German Shepherd")
      
       #undef C
       #define C(a, b) a
      
       enum { DOGS };
      
       #undef C
       #define C(a, b) b
      
       static char dogs[] = { DOGS };
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      e9baef0d
  2. 10 Mar, 2018 38 commits