From: Mathieu Desnoyers Date: Fri, 16 Nov 2012 20:53:09 +0000 (-0500) Subject: Fix: filter link fail handling X-Git-Tag: v2.1.0-rc2~6 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=21af05a99efabef4da5db10dfb41139873eb9692;p=lttng-ust.git Fix: filter link fail handling Reviewed-by: David Goulet Reviewed-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 5010a66e..e45a6a71 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -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 */ }; diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index 4714dad2..62a745f1 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -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; } /*