Fix: handle enablers without bytecode
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Dec 2012 15:11:24 +0000 (10:11 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Dec 2012 15:11:24 +0000 (10:11 -0500)
to reproduce issue with the upstream "hello" program:

lttng create
lttng enable-event -u -a --filter 'intfield==42'
lttng enable-event -u -a
lttng start

./hello
lttng stop
lttng view

only shows event with 42 intfield. We expect all events.

Fixes #406

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
liblttng-ust/lttng-events.c

index 331506bd69d838a0c77075489ec3830b859dbe86..c900b894d381f52cdaeace0f99edaf30272e2248 100644 (file)
@@ -351,7 +351,7 @@ struct lttng_event {
        /* LTTng-UST 2.1 starts here */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
        struct cds_list_head bytecode_runtime_head;
-
+       int has_enablers_without_bytecode;
        /* Backward references: list of lttng_enabler_ref (ref to enablers) */
        struct cds_list_head enablers_ref_head;
 };
index c341e043b0224a4607953be82bea90edd97125d0..63d5af0398a959fe3146d82a54814fe381b840b7 100644 (file)
@@ -489,7 +489,7 @@ 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_record = 0;                                      \
+               int __filter_record = __event->has_enablers_without_bytecode; \
                                                                              \
                __event_prepare_filter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \
                        _TP_ARGS_DATA_VAR(_args));                            \
index 95082ceda6fadd21827db61cde7f56945c3dcdcf..790d14b2495992d893e9d63f15ca8e65a3f6738a 100644 (file)
@@ -1379,7 +1379,7 @@ void lttng_session_sync_enablers(struct lttng_session *session)
        cds_list_for_each_entry(event, &session->events_head, node) {
                struct lttng_enabler_ref *enabler_ref;
                struct lttng_bytecode_runtime *runtime;
-               int enabled = 0;
+               int enabled = 0, has_enablers_without_bytecode = 0;
 
                /* Enable events */
                cds_list_for_each_entry(enabler_ref,
@@ -1391,6 +1391,17 @@ void lttng_session_sync_enablers(struct lttng_session *session)
                }
                event->enabled = enabled;
 
+               /* Check if has enablers without bytecode */
+               cds_list_for_each_entry(enabler_ref,
+                               &event->enablers_ref_head, node) {
+                       if (cds_list_empty(&enabler_ref->ref->filter_bytecode_head)) {
+                               has_enablers_without_bytecode = 1;
+                               break;
+                       }
+               }
+               event->has_enablers_without_bytecode =
+                       has_enablers_without_bytecode;
+
                /* Enable filters */
                cds_list_for_each_entry(runtime,
                                &event->bytecode_runtime_head, node) {
This page took 0.027962 seconds and 4 git commands to generate.