X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fevents.h;h=1eda3aca197fa5c69c197f09616e50198572a65a;hb=ac847066a7e106d38fd18587044622d050dc86a1;hp=a04d0f2a9de586e522854d263fea35ca38998547;hpb=16e1064f1216e90e49ac61752d24df5218d9962e;p=lttng-modules.git diff --git a/include/lttng/events.h b/include/lttng/events.h index a04d0f2a..1eda3aca 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -25,7 +25,7 @@ #define lttng_is_signed_type(type) (((type) -1) < (type) 1) -struct lttng_channel; +struct lttng_kernel_channel_buffer; struct lttng_kernel_session; struct lttng_kernel_ring_buffer_ctx; @@ -49,11 +49,6 @@ enum lttng_kernel_string_encoding { NR_LTTNG_KERNEL_STRING_ENCODING, }; -enum channel_type { - PER_CPU_CHANNEL, - METADATA_CHANNEL, -}; - struct lttng_kernel_enum_value { unsigned long long value; unsigned int signedness:1; @@ -130,6 +125,7 @@ struct lttng_kernel_enum_desc { const char *name; const struct lttng_kernel_enum_entry **entries; unsigned int nr_entries; + const struct lttng_kernel_probe_desc *probe_desc; }; /* Event field description */ @@ -302,13 +298,18 @@ struct lttng_kernel_probe_ctx { uint8_t interruptible; }; +struct lttng_kernel_tracepoint_class { + void (*probe_callback)(void); + const struct lttng_kernel_event_field **fields; /* event payload */ + unsigned int nr_fields; + const struct lttng_kernel_probe_desc *probe_desc; +}; + struct lttng_kernel_event_desc { const char *event_name; /* lttng-modules name */ const char *event_kname; /* Linux kernel name (tracepoints) */ const struct lttng_kernel_probe_desc *probe_desc; - void (*probe_callback)(void); - const struct lttng_kernel_event_field **fields; /* event payload */ - unsigned int nr_fields; + const struct lttng_kernel_tracepoint_class *tp_class; struct module *owner; }; @@ -356,7 +357,7 @@ struct lttng_kernel_event_recorder { struct lttng_kernel_event_common parent; struct lttng_kernel_event_recorder_private *priv; /* Private event record interface */ - struct lttng_channel *chan; + struct lttng_kernel_channel_buffer *chan; }; struct lttng_kernel_notification_ctx { @@ -391,37 +392,32 @@ struct lttng_kernel_channel_buffer_ops { size_t len); void (*event_strcpy_from_user)(struct lttng_kernel_ring_buffer_ctx *ctx, const char __user *src, size_t len); + void (*lost_event_too_big)(struct lttng_kernel_channel_buffer *lttng_channel); +}; + +enum lttng_kernel_channel_type { + LTTNG_KERNEL_CHANNEL_TYPE_BUFFER = 0, }; -struct lttng_channel { - unsigned int id; - struct channel *chan; /* Channel buffers */ +struct lttng_kernel_channel_common_private; + +/* Use container_of() to get child. */ +struct lttng_kernel_channel_common { + struct lttng_kernel_channel_common_private *priv; /* Private channel interface. */ + + enum lttng_kernel_channel_type type; + int enabled; - struct lttng_kernel_ctx *ctx; - /* Event ID management */ struct lttng_kernel_session *session; - struct file *file; /* File associated to channel */ - unsigned int free_event_id; /* Next event ID to allocate */ - struct list_head list; /* Channel list */ +}; + +struct lttng_kernel_channel_buffer_private; + +struct lttng_kernel_channel_buffer { + struct lttng_kernel_channel_common parent; + struct lttng_kernel_channel_buffer_private *priv; + struct lttng_kernel_channel_buffer_ops *ops; - struct lttng_transport *transport; - struct hlist_head *sc_table; /* for syscall tracing */ - struct hlist_head *compat_sc_table; - struct hlist_head *sc_exit_table; /* for syscall exit tracing */ - struct hlist_head *compat_sc_exit_table; - struct hlist_head sc_unknown; /* for unknown syscalls */ - struct hlist_head sc_compat_unknown; - struct hlist_head sc_exit_unknown; - struct hlist_head compat_sc_exit_unknown; - struct lttng_syscall_filter *sc_filter; - int header_type; /* 0: unset, 1: compact, 2: large */ - enum channel_type channel_type; - int syscall_all_entry; - int syscall_all_exit; - unsigned int metadata_dumped:1, - sys_enter_registered:1, - sys_exit_registered:1, - tstate:1; /* Transient enable state */ }; #define LTTNG_DYNAMIC_LEN_STACK_SIZE 128