Fix: filter link fail handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Nov 2012 20:53:09 +0000 (15:53 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Nov 2012 18:56:26 +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-events.h
liblttng-ust/lttng-filter.c

index 5010a66e3e89d5c426f1bbe0f77d93d7026b9efd..e45a6a7187621afc1a09175cacf68409cbc52f23 100644 (file)
@@ -299,6 +299,7 @@ struct lttng_bytecode_runtime {
        /* Associated bytecode */
        struct lttng_ust_filter_bytecode_node *bc;
        int (*filter)(void *filter_data, const char *filter_stack_data);
+       int link_failed;
        struct cds_list_head node;      /* list of bytecode runtime in event */
 };
 
index 4714dad2ad50c1d7d09e0cc3450ee7366c06bbc7..62a745f197c4ddc377a57bcd4eb7404bab21a614 100644 (file)
@@ -289,12 +289,14 @@ int _lttng_filter_event_link_bytecode(struct lttng_event *event,
                goto link_error;
        }
        runtime->p.filter = lttng_filter_interpret_bytecode;
+       runtime->p.link_failed = 0;
        cds_list_add_rcu(&runtime->p.node, insert_loc);
        dbg_printf("Linking successful.\n");
        return 0;
 
 link_error:
        runtime->p.filter = lttng_filter_false;
+       runtime->p.link_failed = 1;
        cds_list_add_rcu(&runtime->p.node, insert_loc);
        dbg_printf("Linking failed.\n");
        return ret;
@@ -304,10 +306,10 @@ void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime)
 {
        struct lttng_ust_filter_bytecode_node *bc = runtime->bc;
 
-       if (bc->enabler->enabled)
-               runtime->filter = lttng_filter_interpret_bytecode;
-       else
+       if (!bc->enabler->enabled || runtime->link_failed)
                runtime->filter = lttng_filter_false;
+       else
+               runtime->filter = lttng_filter_interpret_bytecode;
 }
 
 /*
This page took 0.026124 seconds and 4 git commands to generate.