struct lttng_ust_bytecode_runtime_private;
/*
- * This structure is used in the probes. More specifically, the
- * `interpreter_funcs` and `node` fields are explicity used in the
- * probes. When modifying this structure we must not change the layout
- * of these two fields as it is considered ABI.
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
*/
-struct lttng_bytecode_runtime {
- struct lttng_ust_bytecode_runtime_private *priv;
+struct lttng_ust_bytecode_runtime {
+ uint32_t struct_size; /* Size of this structure. */
+ struct lttng_ust_bytecode_runtime_private *priv;
/* Associated bytecode */
union {
uint64_t (*filter)(void *interpreter_data,
struct lttng_interpreter_output *interpreter_output);
} interpreter_funcs;
struct cds_list_head node; /* list of bytecode runtime in event */
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
/*
int enabled;
int has_enablers_without_bytecode;
- /* list of struct lttng_bytecode_runtime, sorted by seqnum */
+ /* list of struct lttng_ust_bytecode_runtime, sorted by seqnum */
struct cds_list_head filter_bytecode_runtime_head;
/* End of base ABI. Fields below should be used after checking struct_size. */
if (caa_unlikely(!TP_RCU_LINK_TEST())) \
return; \
if (caa_unlikely(!cds_list_empty(&__event->filter_bytecode_runtime_head))) { \
- struct lttng_bytecode_runtime *__filter_bc_runtime; \
+ struct lttng_ust_bytecode_runtime *__filter_bc_runtime; \
int __filter_record = __event->has_enablers_without_bytecode; \
\
__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
notification_init(¬if, event_notifier);
if (caa_unlikely(!cds_list_empty(&event_notifier->capture_bytecode_runtime_head))) {
- struct lttng_bytecode_runtime *capture_bc_runtime;
+ struct lttng_ust_bytecode_runtime *capture_bc_runtime;
/*
* Iterate over all the capture bytecodes. If the interpreter
int bytecode_is_linked(struct lttng_ust_bytecode_node *bytecode,
struct cds_list_head *bytecode_runtime_head)
{
- struct lttng_bytecode_runtime *bc_runtime;
+ struct lttng_ust_bytecode_runtime *bc_runtime;
cds_list_for_each_entry(bc_runtime, bytecode_runtime_head, node) {
if (bc_runtime->priv->bc == bytecode)
goto alloc_error;
}
runtime->p.priv = runtime_priv;
+ runtime->p.struct_size = sizeof(struct lttng_ust_bytecode_runtime);
runtime_priv->pub = runtime;
runtime_priv->bc = bytecode;
runtime_priv->pctx = ctx;
return ret;
}
-void lttng_bytecode_filter_sync_state(struct lttng_bytecode_runtime *runtime)
+void lttng_bytecode_filter_sync_state(struct lttng_ust_bytecode_runtime *runtime)
{
struct lttng_ust_bytecode_node *bc = runtime->priv->bc;
runtime->interpreter_funcs.filter = lttng_bytecode_filter_interpret;
}
-void lttng_bytecode_capture_sync_state(struct lttng_bytecode_runtime *runtime)
+void lttng_bytecode_capture_sync_state(struct lttng_ust_bytecode_runtime *runtime)
{
struct lttng_ust_bytecode_node *bc = runtime->priv->bc;
struct cds_list_head *enabler_bytecode_head)
{
struct lttng_ust_bytecode_node *enabler_bc;
- struct lttng_bytecode_runtime *runtime;
+ struct lttng_ust_bytecode_runtime *runtime;
assert(event_desc);
/* Linked bytecode. Child of struct lttng_bytecode_runtime. */
struct bytecode_runtime {
- struct lttng_bytecode_runtime p;
+ struct lttng_ust_bytecode_runtime p;
size_t data_len;
size_t data_alloc_len;
char *data;
const char *lttng_bytecode_print_op(enum bytecode_op op);
LTTNG_HIDDEN
-void lttng_bytecode_filter_sync_state(struct lttng_bytecode_runtime *runtime);
+void lttng_bytecode_filter_sync_state(struct lttng_ust_bytecode_runtime *runtime);
LTTNG_HIDDEN
-void lttng_bytecode_capture_sync_state(struct lttng_bytecode_runtime *runtime);
+void lttng_bytecode_capture_sync_state(struct lttng_ust_bytecode_runtime *runtime);
LTTNG_HIDDEN
int lttng_bytecode_validate(struct bytecode_runtime *bytecode);
*/
cds_list_for_each_entry(event_recorder_priv, &session->priv->events_head, node) {
struct lttng_enabler_ref *enabler_ref;
- struct lttng_bytecode_runtime *runtime;
+ struct lttng_ust_bytecode_runtime *runtime;
int enabled = 0, has_enablers_without_bytecode = 0;
/* Enable events */
*/
cds_list_for_each_entry(event_notifier_priv, &event_notifier_group->event_notifiers_head, node) {
struct lttng_enabler_ref *enabler_ref;
- struct lttng_bytecode_runtime *runtime;
+ struct lttng_ust_bytecode_runtime *runtime;
int enabled = 0, has_enablers_without_bytecode = 0;
/* Enable event_notifiers */