X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fevents-internal.h;h=6b4189770ee7686f17fb2d88373ce534c34106fb;hb=8a57ec025ffbe56153748fd69b60118862707182;hp=128484a8ec312672615a2665527596326ba97d20;hpb=e8c0bbd373ddb18f409f6ac3c9d00dfebdab74ef;p=lttng-modules.git diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index 128484a8..6b418977 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -216,7 +216,7 @@ struct lttng_kernel_ctx_field { size_t (*get_size)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset); void (*record)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, - struct lib_ring_buffer_ctx *ctx, + struct lttng_kernel_ring_buffer_ctx *ctx, struct lttng_channel *chan); void (*get_value)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, struct lttng_ctx_value *value); @@ -231,6 +231,70 @@ struct lttng_kernel_ctx { size_t largest_align; /* in bytes */ }; +struct lttng_metadata_cache { + char *data; /* Metadata cache */ + unsigned int cache_alloc; /* Metadata allocated size (bytes) */ + unsigned int metadata_written; /* Number of bytes written in metadata cache */ + atomic_t producing; /* Metadata being produced (incomplete) */ + struct kref refcount; /* Metadata cache usage */ + struct list_head metadata_stream; /* Metadata stream list */ + uuid_le uuid; /* Trace session unique ID (copy) */ + struct mutex lock; /* Produce/consume lock */ + uint64_t version; /* Current version of the metadata */ +}; + +struct lttng_kernel_channel_buffer_ops_private { + struct lttng_kernel_channel_buffer_ops *pub; /* Public channel buffer ops interface */ + + struct channel *(*channel_create)(const char *name, + void *priv, + void *buf_addr, + size_t subbuf_size, size_t num_subbuf, + unsigned int switch_timer_interval, + unsigned int read_timer_interval); + void (*channel_destroy)(struct channel *chan); + 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); + /* + * packet_avail_size returns the available size in the current + * packet. Note that the size returned is only a hint, since it + * may change due to concurrent writes. + */ + size_t (*packet_avail_size)(struct channel *chan); + wait_queue_head_t *(*get_writer_buf_wait_queue)(struct channel *chan, int cpu); + wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan); + int (*is_finalized)(struct channel *chan); + int (*is_disabled)(struct channel *chan); + int (*timestamp_begin) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *timestamp_begin); + int (*timestamp_end) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *timestamp_end); + int (*events_discarded) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *events_discarded); + int (*content_size) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *content_size); + int (*packet_size) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *packet_size); + int (*stream_id) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *stream_id); + int (*current_timestamp) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *ts); + int (*sequence_number) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *seq); + int (*instance_id) (const struct lib_ring_buffer_config *config, + struct lib_ring_buffer *bufb, + uint64_t *id); +}; + extern struct lttng_kernel_ctx *lttng_static_ctx; static inline