From: Francis Deslauriers Date: Fri, 20 Mar 2020 14:52:21 +0000 (-0400) Subject: Record event as soon as one filters evaluates to TRUE X-Git-Tag: v2.13.0-rc1~523 X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=5ffb7c14f2a7e58ff18864c0d14909bdf23bc65d Record event as soon as one filters evaluates to TRUE This is a tiny optimization but it can reduce tracing cost in cases where multiple filters are attached to a probe. Since we want to trace the event if any of its filter expressions evaluates to TRUE, there is no need to keep on evaluating expression once one is found to be TRUE. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I2bb8fafb3052fce02b10f541e025a9a74ffa1895 --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 336125a6..380593b0 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -808,8 +808,10 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ _TP_ARGS_DATA_VAR(_args)); \ tp_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ if (caa_unlikely(bc_runtime->filter(bc_runtime, \ - __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \ + __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) { \ __filter_record = 1; \ + break; \ + } \ } \ if (caa_likely(!__filter_record)) \ return; \