tracing: Reimplement log2
authorTom Zanussi <tom.zanussi@linux.intel.com>
Fri, 22 Sep 2017 19:58:23 +0000 (14:58 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 4 Oct 2017 17:10:39 +0000 (13:10 -0400)
commit5819eaddf35b24d628ddfa4fbb5f8d4026e44b96
treedff913d4ff34893f9e3ded5ca780832c8b6c74c3
parent85013256cf01629f72a327674c5d007b4a4b40da
tracing: Reimplement log2

log2 as currently implemented applies only to u64 trace_event_field
derived fields, and assumes that anything it's applied to is a u64
field.

To prepare for synthetic fields like latencies, log2 should be
applicable to those as well, so take the opportunity now to fix the
current problems as well as expand to more general uses.

log2 should be thought of as a chaining function rather than a field
type.  To enable this as well as possible future function
implementations, add a hist_field operand array into the hist_field
definition for this purpose, and make use of it to implement the log2
'function'.

Link: http://lkml.kernel.org/r/b47f93fc0b87b36eccf716b0c018f3a71e1f1111.1506105045.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c