runtime->p.priv = runtime_priv;
runtime->p.struct_size = sizeof(struct lttng_ust_bytecode_runtime);
runtime_priv->pub = runtime;
+ runtime_priv->type = bytecode->type;
runtime_priv->bc = bytecode;
runtime_priv->pctx = ctx;
runtime->len = bytecode->bc.reloc_offset;
goto link_error;
}
- switch (bytecode->type) {
- 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();
- }
-
+ runtime->p.interpreter_func = lttng_bytecode_interpret;
runtime->p.priv->link_failed = 0;
cds_list_add_rcu(&runtime->p.node, insert_loc);
dbg_printf("Linking successful.\n");
return 0;
link_error:
- switch (bytecode->type) {
- 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();
- }
-
+ runtime->p.interpreter_func = lttng_bytecode_interpret_error;
runtime_priv->link_failed = 1;
cds_list_add_rcu(&runtime->p.node, insert_loc);
alloc_error:
return ret;
}
-void lttng_bytecode_filter_sync_state(struct lttng_ust_bytecode_runtime *runtime)
-{
- struct lttng_ust_bytecode_node *bc = runtime->priv->bc;
-
- if (!bc->enabler->enabled || runtime->priv->link_failed)
- runtime->interpreter_funcs.filter = lttng_bytecode_filter_interpret_false;
- else
- runtime->interpreter_funcs.filter = lttng_bytecode_filter_interpret;
-}
-
-void lttng_bytecode_capture_sync_state(struct lttng_ust_bytecode_runtime *runtime)
+void lttng_bytecode_sync_state(struct lttng_ust_bytecode_runtime *runtime)
{
struct lttng_ust_bytecode_node *bc = runtime->priv->bc;
if (!bc->enabler->enabled || runtime->priv->link_failed)
- runtime->interpreter_funcs.capture = lttng_bytecode_capture_interpret_false;
+ runtime->interpreter_func = lttng_bytecode_interpret_error;
else
- runtime->interpreter_funcs.capture = lttng_bytecode_capture_interpret;
+ runtime->interpreter_func = lttng_bytecode_interpret;
}
/*