]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/filter: Optimize filter by folding the tree
authorSteven Rostedt <srostedt@redhat.com>
Fri, 28 Jan 2011 04:16:51 +0000 (23:16 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 8 Feb 2011 01:56:19 +0000 (20:56 -0500)
commit248122b9f88da501dc88ad2b7bd0771f0b694ea7
treecbb50e071a8149e2da7be995166f487bbcb5172a
parent7fe9155b13e346778bba82a20d0128b36bdcf8a0
tracing/filter: Optimize filter by folding the tree

There are many cases that a filter will contain multiple ORs or
ANDs together near the leafs. Walking up and down the tree to get
to the next compare can be a waste.

If there are several ORs or ANDs together, fold them into a single
pred and allocate an array of the conditions that they check.
This will speed up the filter by linearly walking an array
and can still break out if a short circuit condition is met.

Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.h
kernel/trace/trace_events_filter.c