Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eabb8980 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt
Browse files

tracing: Allow NOT to filter AND and OR clauses



Add support to allow not "!" for and (&&) and (||). That is:

 !(field1 == X && field2 == Y)

Where the value of the full clause will be notted.

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent e12c09cf
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -489,9 +489,10 @@ static int process_ops(struct filter_pred *preds,
		if (!WARN_ON_ONCE(!pred->fn))
		if (!WARN_ON_ONCE(!pred->fn))
			match = pred->fn(pred, rec);
			match = pred->fn(pred, rec);
		if (!!match == type)
		if (!!match == type)
			return match;
			break;
	}
	}
	return match;
	/* If not of not match is equal to not of not, then it is a match */
	return !!match == !op->not;
}
}


struct filter_match_preds_data {
struct filter_match_preds_data {
@@ -740,10 +741,10 @@ static int filter_set_pred(struct event_filter *filter,
		 * then this op can be folded.
		 * then this op can be folded.
		 */
		 */
		if (left->index & FILTER_PRED_FOLD &&
		if (left->index & FILTER_PRED_FOLD &&
		    (left->op == dest->op ||
		    ((left->op == dest->op && !left->not) ||
		     left->left == FILTER_PRED_INVALID) &&
		     left->left == FILTER_PRED_INVALID) &&
		    right->index & FILTER_PRED_FOLD &&
		    right->index & FILTER_PRED_FOLD &&
		    (right->op == dest->op ||
		    ((right->op == dest->op && !right->not) ||
		     right->left == FILTER_PRED_INVALID))
		     right->left == FILTER_PRED_INVALID))
			dest->index |= FILTER_PRED_FOLD;
			dest->index |= FILTER_PRED_FOLD;