X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust%2Flttng-bytecode.c;h=ca8914ede7251291e5d9343ccb0a5514bb8b812c;hb=7e80521b0585468a7ae9ad1cc1d862c8c7b3567e;hp=a6527ff191e1a34f706933523a1248c48d4c2321;hpb=621c07fc1b90c12ec997d539770da1937d11c450;p=lttng-ust.git diff --git a/liblttng-ust/lttng-bytecode.c b/liblttng-ust/lttng-bytecode.c index a6527ff1..ca8914ed 100644 --- a/liblttng-ust/lttng-bytecode.c +++ b/liblttng-ust/lttng-bytecode.c @@ -298,21 +298,21 @@ int apply_context_reloc(struct bytecode_runtime *runtime, struct load_op *op; struct lttng_ctx_field *ctx_field; int idx; - struct lttng_ctx *ctx = *runtime->p.pctx; + struct lttng_ctx **pctx = runtime->p.pctx; dbg_printf("Apply context reloc: %u %s\n", reloc_offset, context_name); /* Get context index */ - idx = lttng_get_context_index(ctx, context_name); + idx = lttng_get_context_index(*pctx, context_name); if (idx < 0) { if (lttng_context_is_app(context_name)) { int ret; ret = lttng_ust_add_app_context_to_ctx_rcu(context_name, - &ctx); + pctx); if (ret) return ret; - idx = lttng_get_context_index(ctx, context_name); + idx = lttng_get_context_index(*pctx, context_name); if (idx < 0) return -ENOENT; } else { @@ -324,7 +324,7 @@ int apply_context_reloc(struct bytecode_runtime *runtime, return -EINVAL; /* Get context return type */ - ctx_field = &ctx->fields[idx]; + ctx_field = &(*pctx)->fields[idx]; op = (struct load_op *) &runtime->code[reloc_offset]; switch (bytecode_op) { @@ -483,6 +483,9 @@ int link_bytecode(const struct lttng_event_desc *event_desc, case LTTNG_UST_BYTECODE_NODE_TYPE_FILTER: runtime->p.interpreter_funcs.filter = lttng_bytecode_filter_interpret; break; + case LTTNG_UST_BYTECODE_NODE_TYPE_CAPTURE: + runtime->p.interpreter_funcs.capture = lttng_bytecode_capture_interpret; + break; default: abort(); } @@ -497,6 +500,9 @@ link_error: case LTTNG_UST_BYTECODE_NODE_TYPE_FILTER: runtime->p.interpreter_funcs.filter = lttng_bytecode_filter_interpret_false; break; + case LTTNG_UST_BYTECODE_NODE_TYPE_CAPTURE: + runtime->p.interpreter_funcs.capture = lttng_bytecode_capture_interpret_false; + break; default: abort(); } @@ -518,6 +524,16 @@ void lttng_bytecode_filter_sync_state(struct lttng_bytecode_runtime *runtime) runtime->interpreter_funcs.filter = lttng_bytecode_filter_interpret; } +void lttng_bytecode_capture_sync_state(struct lttng_bytecode_runtime *runtime) +{ + struct lttng_ust_bytecode_node *bc = runtime->bc; + + if (!bc->enabler->enabled || runtime->link_failed) + runtime->interpreter_funcs.capture = lttng_bytecode_capture_interpret_false; + else + runtime->interpreter_funcs.capture = lttng_bytecode_capture_interpret; +} + /* * Given the lists of bytecode programs of an instance (trigger or event) and * of a matching enabler, try to link all the enabler's bytecode programs with @@ -616,8 +632,3 @@ void lttng_free_event_notifier_filter_runtime( { free_filter_runtime(&event_notifier->filter_bytecode_runtime_head); } - -/* For backward compatibility. Leave those exported symbols in place. */ -void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime) -{ -}