bytecode: generalize `struct lttng_filter_bytecode_node`
[lttng-modules.git] / include / lttng / events.h
index 6125f08bc1d63a90c26cdfe446e7f6470abc7b04..517d689b049f05d679fa4a205da31d2b20cb1e10 100644 (file)
@@ -232,14 +232,20 @@ enum lttng_event_type {
        LTTNG_TYPE_ENABLER = 1,
 };
 
-struct lttng_filter_bytecode_node {
+enum lttng_bytecode_node_type {
+       LTTNG_BYTECODE_NODE_TYPE_FILTER,
+};
+
+struct lttng_bytecode_node {
+       enum lttng_bytecode_node_type type;
        struct list_head node;
        struct lttng_enabler *enabler;
-       /*
-        * struct lttng_kernel_filter_bytecode has var. sized array, must be
-        * last field.
-        */
-       struct lttng_kernel_filter_bytecode bc;
+       struct {
+               uint32_t len;
+               uint32_t reloc_offset;
+               uint64_t seqnum;
+               char data[];
+       } bc;
 };
 
 /*
@@ -253,8 +259,9 @@ enum lttng_filter_ret {
 
 struct lttng_bytecode_runtime {
        /* Associated bytecode */
-       struct lttng_filter_bytecode_node *bc;
-       uint64_t (*filter)(void *filter_data, struct lttng_probe_ctx *lttng_probe_ctx,
+       struct lttng_bytecode_node *bc;
+       uint64_t (*filter)(void *filter_data,
+                       struct lttng_probe_ctx *lttng_probe_ctx,
                        const char *filter_stack_data);
        int link_failed;
        struct list_head node;  /* list of bytecode runtime in event */
@@ -332,7 +339,7 @@ struct lttng_event {
        struct hlist_node hlist;        /* session ht of events */
        int registered;                 /* has reg'd tracepoint probe */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
-       struct list_head bytecode_runtime_head;
+       struct list_head filter_bytecode_runtime_head;
        int has_enablers_without_bytecode;
 };
 
@@ -363,7 +370,7 @@ struct lttng_event_notifier {
        struct list_head enablers_ref_head;
        struct hlist_node hlist;        /* session ht of event_notifiers */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
-       struct list_head bytecode_runtime_head;
+       struct list_head filter_bytecode_runtime_head;
        int has_enablers_without_bytecode;
 
        void (*send_notification)(struct lttng_event_notifier *event_notifier);
@@ -887,9 +894,9 @@ static inline int lttng_syscall_filter_disable_event_notifier(
 #endif
 
 void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime);
-int lttng_event_enabler_attach_bytecode(struct lttng_event_enabler *event_enabler,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode);
-int lttng_event_notifier_enabler_attach_bytecode(
+int lttng_event_notifier_enabler_attach_filter_bytecode(
                struct lttng_event_notifier_enabler *event_notifier_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode);
 
This page took 0.026442 seconds and 4 git commands to generate.