fix: uuid: Decouple guid_t and uuid_le types and respective macros (v6.3)
[lttng-modules.git] / include / lttng / events-internal.h
index 1108cf273ce342b7ec4d74658304d768b2e5f238..a91a659ebdeb586eb8a0d515214f841729e28b6a 100644 (file)
@@ -8,13 +8,16 @@
 #ifndef _LTTNG_EVENTS_INTERNAL_H
 #define _LTTNG_EVENTS_INTERNAL_H
 
+#include <wrapper/compiler_attributes.h>
+#include <wrapper/uuid.h>
+
 #include <lttng/events.h>
 
 struct lttng_syscall_filter;
 struct lttng_metadata_cache;
 struct perf_event;
 struct perf_event_attr;
-struct lib_ring_buffer_config;
+struct lttng_kernel_ring_buffer_config;
 
 enum lttng_enabler_format_type {
        LTTNG_ENABLER_FORMAT_STAR_GLOB,
@@ -149,7 +152,7 @@ struct lttng_kernel_channel_buffer_private {
 
        enum channel_type channel_type;
        struct lttng_kernel_ctx *ctx;
-       struct channel *rb_chan;                /* Ring buffer channel */
+       struct lttng_kernel_ring_buffer_channel *rb_chan;               /* Ring buffer channel */
        unsigned int metadata_dumped:1;
        struct list_head node;                  /* Channel list in session */
        struct lttng_transport *transport;
@@ -287,7 +290,7 @@ struct lttng_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) */
+       guid_t uuid;                    /* Trace session unique ID (copy) */
        struct mutex lock;              /* Produce/consume lock */
        uint64_t version;               /* Current version of the metadata */
 };
@@ -308,52 +311,52 @@ struct lttng_metadata_stream {
 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,
+       struct lttng_kernel_ring_buffer_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);
+       void (*channel_destroy)(struct lttng_kernel_ring_buffer_channel *chan);
+       struct lttng_kernel_ring_buffer *(*buffer_read_open)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*buffer_has_read_closed_stream)(struct lttng_kernel_ring_buffer_channel *chan);
+       void (*buffer_read_close)(struct lttng_kernel_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,
+       size_t (*packet_avail_size)(struct lttng_kernel_ring_buffer_channel *chan);
+       wait_queue_head_t *(*get_writer_buf_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan, int cpu);
+       wait_queue_head_t *(*get_hp_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*is_finalized)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*is_disabled)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*timestamp_begin) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *timestamp_begin);
-       int (*timestamp_end) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*timestamp_end) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *timestamp_end);
-       int (*events_discarded) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*events_discarded) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *events_discarded);
-       int (*content_size) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*content_size) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *content_size);
-       int (*packet_size) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*packet_size) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *packet_size);
-       int (*stream_id) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*stream_id) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *stream_id);
-       int (*current_timestamp) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*current_timestamp) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *ts);
-       int (*sequence_number) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*sequence_number) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *seq);
-       int (*instance_id) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*instance_id) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *id);
 };
 
@@ -403,8 +406,8 @@ struct lttng_event_notifier_group {
        struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */
        struct lttng_kernel_channel_buffer_ops *ops;
        struct lttng_transport *transport;
-       struct channel *chan;           /* Ring buffer channel for event notifier group. */
-       struct lib_ring_buffer *buf;    /* Ring buffer for event notifier group. */
+       struct lttng_kernel_ring_buffer_channel *chan;          /* Ring buffer channel for event notifier group. */
+       struct lttng_kernel_ring_buffer *buf;   /* Ring buffer for event notifier group. */
        wait_queue_head_t read_wait;
        struct irq_work wakeup_pending; /* Pending wakeup irq work. */
        struct lttng_kernel_event_notifier *sc_unknown; /* for unknown syscalls */
@@ -461,7 +464,7 @@ struct lttng_kernel_session_private {
        struct list_head events;                /* Event list head */
        struct list_head list;                  /* Session list */
        unsigned int free_chan_id;              /* Next chan ID to allocate */
-       uuid_le uuid;                           /* Trace session unique ID */
+       guid_t uuid;                            /* Trace session unique ID */
        struct lttng_metadata_cache *metadata_cache;
        unsigned int metadata_dumped:1,
                tstate:1;                       /* Transient enable state */
@@ -561,9 +564,12 @@ static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kern
        if (!type_integer)
                return false;
        switch (type_integer->size) {
-       case 8:         /* Fall-through. */
-       case 16:        /* Fall-through. */
-       case 32:        /* Fall-through. */
+       case 8:
+               lttng_fallthrough;
+       case 16:
+               lttng_fallthrough;
+       case 32:
+               lttng_fallthrough;
        case 64:
                break;
        default:
@@ -714,7 +720,8 @@ int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx)
 #endif
 
 #if defined(CONFIG_TIME_NS) && \
-       (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
+       (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
+       LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx);
 #else
 static inline
@@ -842,25 +849,34 @@ static inline int lttng_syscalls_destroy(struct lttng_kernel_channel_buffer *cha
 }
 
 static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_channel_buffer *chan,
-               struct lttng_kernel_event_recorder *event);
+               struct lttng_kernel_event_recorder *event)
 {
        return -ENOSYS;
 }
 
 static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_channel_buffer *chan,
-               struct lttng_kernel_event_recorder *event);
+               struct lttng_kernel_event_recorder *event)
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan)
+{
+       return 0;
+}
+
+static inline int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_notifier_enabler *event_notifier_enabler)
 {
        return -ENOSYS;
 }
 
 static inline long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
-               struct lttng_kernel_syscall_mask __user *usyscall_mask)
+               struct lttng_kernel_abi_syscall_mask __user *usyscall_mask)
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_group *group)
+static inline int lttng_syscalls_register_event_notifier(struct lttng_event_notifier_enabler *event_notifier_enabler)
 {
        return -ENOSYS;
 }
@@ -871,16 +887,12 @@ static inline int lttng_syscalls_unregister_event_notifier_group(
        return 0;
 }
 
-static inline int lttng_syscall_filter_enable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
+static inline int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscall_filter_disable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
+static inline int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
 {
        return -ENOSYS;
 }
@@ -1140,7 +1152,7 @@ int lttng_probes_init(void);
 void lttng_probes_exit(void);
 
 int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
-               struct channel *chan, bool *coherent);
+               struct lttng_kernel_ring_buffer_channel *chan, bool *coherent);
 
 int lttng_id_tracker_get_node_id(const struct lttng_id_hash_node *node);
 int lttng_id_tracker_empty_set(struct lttng_kernel_id_tracker *lf);
This page took 0.02903 seconds and 4 git commands to generate.