filters: perform union rather than intersection
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Nov 2012 16:17:21 +0000 (11:17 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Nov 2012 18:56:16 +0000 (13:56 -0500)
Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-tracepoint-event.h

index a9de4a7aeae020dac741a6cd951d305d4c62e157..fdecda706b5f0c81a61cc03ace4ba51826015e7d 100644 (file)
@@ -459,6 +459,7 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
  * each field (worse case). For integers, max size required is 64-bit.
  * Same for double-precision floats. Those fit within
  * 2*sizeof(unsigned long) for all supported architectures.
+ * Perform UNION (||) of filter runtime list.
  */
 #undef TRACEPOINT_EVENT_CLASS
 #define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields)             \
@@ -488,14 +489,17 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))         \
                return;                                                       \
        if (caa_unlikely(!cds_list_empty(&__event->bytecode_runtime_head))) { \
                struct lttng_bytecode_runtime *bc_runtime;                    \
+               int __filter_result = 0;                                      \
                                                                              \
                __event_prepare_filter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \
                        _TP_ARGS_DATA_VAR(_args));                            \
                cds_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \
-                       if (caa_likely(!bc_runtime->filter(bc_runtime,        \
+                       if (caa_unlikely(bc_runtime->filter(bc_runtime,       \
                                        __stackvar.__filter_stack_data)))     \
-                               return;                                       \
+                               __filter_result = 1;                          \
                }                                                             \
+               if (caa_likely(!__filter_result))                             \
+                       return;                                               \
        }                                                                     \
        __event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
                 _TP_ARGS_DATA_VAR(_args));                                   \
This page took 0.0306 seconds and 4 git commands to generate.