X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Flttng%2Fevents.h;h=8c200bdd49787ee7b5960f1bff741eea1413d838;hb=c2fb9c1c4f890840c02ad4b66a7cf69ae5dca6f7;hp=c396e790d76e4663a0beac722c1112e9cc772535;hpb=a775608d0d1d6142c80c26b21ff79bf7e04d8e53;p=lttng-modules.git diff --git a/include/lttng/events.h b/include/lttng/events.h index c396e790..8c200bdd 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -109,7 +109,7 @@ struct lttng_kernel_type_array { struct lttng_kernel_type_sequence { struct lttng_kernel_type_common parent; - const char *length_name; /* Length field name. */ + const char *length_name; /* Length field name. If NULL, use previous field. */ const struct lttng_kernel_type_common *elem_type; unsigned int alignment; /* Alignment before elements. */ enum lttng_kernel_string_encoding encoding; @@ -124,7 +124,7 @@ struct lttng_kernel_type_struct { struct lttng_kernel_type_variant { struct lttng_kernel_type_common parent; - const char *tag_name; + const char *tag_name; /* Tag field name. If NULL, use previous field. */ const struct lttng_kernel_event_field **choices; /* Array of pointers to fields. */ unsigned int nr_choices; unsigned int alignment; @@ -376,13 +376,13 @@ struct lttng_kernel_probe_desc { struct lttng_krp; /* Kretprobe handling */ -enum lttng_bytecode_node_type { - LTTNG_BYTECODE_NODE_TYPE_FILTER, - LTTNG_BYTECODE_NODE_TYPE_CAPTURE, +enum lttng_kernel_bytecode_type { + LTTNG_KERNEL_BYTECODE_TYPE_FILTER, + LTTNG_KERNEL_BYTECODE_TYPE_CAPTURE, }; struct lttng_bytecode_node { - enum lttng_bytecode_node_type type; + enum lttng_kernel_bytecode_type type; struct list_head node; struct lttng_enabler *enabler; struct { @@ -393,29 +393,16 @@ struct lttng_bytecode_node { } bc; }; -/* - * Bytecode interpreter return value masks. - */ -enum lttng_bytecode_interpreter_ret { - LTTNG_INTERPRETER_DISCARD = 0, - LTTNG_INTERPRETER_RECORD_FLAG = (1ULL << 0), - /* Other bits are kept for future use. */ -}; - struct lttng_interpreter_output; struct lttng_bytecode_runtime { /* Associated bytecode */ + enum lttng_kernel_bytecode_type type; struct lttng_bytecode_node *bc; - union { - uint64_t (*filter)(void *filter_data, - struct lttng_probe_ctx *lttng_probe_ctx, - const char *filter_stack_data); - uint64_t (*capture)(void *filter_data, - const char *capture_stack_data, + int (*interpreter_func)(struct lttng_bytecode_runtime *kernel_bytecode, + const char *interpreter_stack_data, struct lttng_probe_ctx *lttng_probe_ctx, - struct lttng_interpreter_output *output); - } interpreter_funcs; + void *caller_ctx); int link_failed; struct list_head node; /* list of bytecode runtime in event */ struct lttng_kernel_ctx *ctx; @@ -456,6 +443,14 @@ enum lttng_syscall_abi { LTTNG_SYSCALL_ABI_COMPAT, }; +/* + * Result of the run_filter() callback. + */ +enum lttng_kernel_event_filter_result { + LTTNG_KERNEL_EVENT_FILTER_ACCEPT = 0, + LTTNG_KERNEL_EVENT_FILTER_REJECT = 1, +}; + struct lttng_kernel_event_common_private; enum lttng_kernel_event_type { @@ -471,8 +466,9 @@ struct lttng_kernel_event_common { int enabled; int eval_filter; /* Need to evaluate filters */ - int (*run_filter)(struct lttng_kernel_event_common *event, + int (*run_filter)(const struct lttng_kernel_event_common *event, const char *stack_data, + struct lttng_probe_ctx *probe_ctx, void *filter_ctx); }; @@ -566,8 +562,7 @@ struct lttng_channel_ops { struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan); int (*buffer_has_read_closed_stream)(struct channel *chan); void (*buffer_read_close)(struct lib_ring_buffer *buf); - int (*event_reserve)(struct lib_ring_buffer_ctx *ctx, - uint32_t event_id); + int (*event_reserve)(struct lib_ring_buffer_ctx *ctx); void (*event_commit)(struct lib_ring_buffer_ctx *ctx); void (*event_write)(struct lib_ring_buffer_ctx *ctx, const void *src, size_t len);