Re: [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster

From: Jiri Olsa
Date: Mon Mar 12 2018 - 08:42:53 EST


On Fri, Mar 09, 2018 at 09:34:45PM -0500, Steven Rostedt wrote:

SNIP

>
> -/* If not of not match is equal to not of not, then it is a match */
> +/*
> + * Without going into a formal proof, this explains the method that is used in
> + * parsing the logical expressions.
> + *
> + * For example, if we have: "a && !(!b || (c && g)) || d || e && !f"
> + * The first pass will convert it into the following program:
> + *
> + * n1: r=a; l1: if (!r) goto l4;
> + * n2: r=b; l2: if (!r) goto l4;

got stuck in here.. should that be 'goto l5' ?

jirka

> + * n3: r=c; r=!r; l3: if (r) goto l4;
> + * n4: r=g; r=!r; l4: if (r) goto l5;
> + * n5: r=d; l5: if (r) goto T
> + * n6: r=e; l6: if (!r) goto l7;
> + * n7: r=f; r=!r; l7: if (!r) goto F
> + * T: return TRUE
> + * F: return FALSE

jirka