Cleanup: update stale file paths in LICENSE
[lttng-modules.git] / include / ringbuffer / config.h
index bc638f941f20365d76fef12b004c0619fe10934a..e63463b08ef45b8fd6540681f636630ef6763db5 100644 (file)
 #include <lttng/align.h>
 #include <lttng/tracer-core.h>
 
-struct lib_ring_buffer;
-struct channel;
-struct lib_ring_buffer_config;
-struct lib_ring_buffer_ctx;
+struct lttng_kernel_ring_buffer;
+struct lttng_kernel_ring_buffer_channel;
+struct lttng_kernel_ring_buffer_config;
+struct lttng_kernel_ring_buffer_ctx;
 struct lttng_kernel_ring_buffer_ctx_private;
 
 /*
@@ -28,42 +28,43 @@ struct lttng_kernel_ring_buffer_ctx_private;
  * provided as inline functions too.  These may simply return 0 if not used by
  * the client.
  */
-struct lib_ring_buffer_client_cb {
+struct lttng_kernel_ring_buffer_client_cb {
        /* Mandatory callbacks */
 
        /* A static inline version is also required for fast path */
-       u64 (*ring_buffer_clock_read) (struct channel *chan);
-       size_t (*record_header_size) (const struct lib_ring_buffer_config *config,
-                                     struct channel *chan, size_t offset,
+       u64 (*ring_buffer_clock_read) (struct lttng_kernel_ring_buffer_channel *chan);
+       size_t (*record_header_size) (const struct lttng_kernel_ring_buffer_config *config,
+                                     struct lttng_kernel_ring_buffer_channel *chan, size_t offset,
                                      size_t *pre_header_padding,
-                                     struct lib_ring_buffer_ctx *ctx,
+                                     struct lttng_kernel_ring_buffer_ctx *ctx,
                                      void *client_ctx);
 
        /* Slow path only, at subbuffer switch */
        size_t (*subbuffer_header_size) (void);
-       void (*buffer_begin) (struct lib_ring_buffer *buf, u64 tsc,
+       void (*buffer_begin) (struct lttng_kernel_ring_buffer *buf, u64 timestamp,
                              unsigned int subbuf_idx);
-       void (*buffer_end) (struct lib_ring_buffer *buf, u64 tsc,
-                           unsigned int subbuf_idx, unsigned long data_size);
+       void (*buffer_end) (struct lttng_kernel_ring_buffer *buf, u64 timestamp,
+                           unsigned int subbuf_idx, unsigned long data_size,
+                           const struct lttng_kernel_ring_buffer_ctx *ctx);
 
        /* Optional callbacks (can be set to NULL) */
 
        /* Called at buffer creation/finalize */
-       int (*buffer_create) (struct lib_ring_buffer *buf, void *priv,
+       int (*buffer_create) (struct lttng_kernel_ring_buffer *buf, void *priv,
                              int cpu, const char *name);
        /*
         * Clients should guarantee that no new reader handle can be opened
         * after finalize.
         */
-       void (*buffer_finalize) (struct lib_ring_buffer *buf, void *priv, int cpu);
+       void (*buffer_finalize) (struct lttng_kernel_ring_buffer *buf, void *priv, int cpu);
 
        /*
         * Extract header length, payload length and timestamp from event
         * record. Used by buffer iterators. Timestamp is only used by channel
         * iterator.
         */
-       void (*record_get) (const struct lib_ring_buffer_config *config,
-                           struct channel *chan, struct lib_ring_buffer *buf,
+       void (*record_get) (const struct lttng_kernel_ring_buffer_config *config,
+                           struct lttng_kernel_ring_buffer_channel *chan, struct lttng_kernel_ring_buffer *buf,
                            size_t offset, size_t *header_len,
                            size_t *payload_len, u64 *timestamp);
 };
@@ -109,7 +110,7 @@ struct lib_ring_buffer_client_cb {
  * RING_BUFFER_WAKEUP_NONE does not perform any wakeup whatsoever. The client
  * has the responsibility to perform wakeups.
  */
-struct lib_ring_buffer_config {
+struct lttng_kernel_ring_buffer_config {
        enum {
                RING_BUFFER_ALLOC_PER_CPU,
                RING_BUFFER_ALLOC_GLOBAL,
@@ -150,11 +151,11 @@ struct lib_ring_buffer_config {
                                                 */
        } wakeup;
        /*
-        * tsc_bits: timestamp bits saved at each record.
+        * timestamp_bits: timestamp bits saved at each record.
         *   0 and 64 disable the timestamp compression scheme.
         */
-       unsigned int tsc_bits;
-       struct lib_ring_buffer_client_cb cb;
+       unsigned int timestamp_bits;
+       struct lttng_kernel_ring_buffer_client_cb cb;
 };
 
 /*
@@ -169,7 +170,7 @@ struct lib_ring_buffer_config {
 
 struct lttng_kernel_ring_buffer_ctx_private {
        /* input received by lib_ring_buffer_reserve(). */
-       struct channel *chan;                   /* ring buffer channel */
+       struct lttng_kernel_ring_buffer_channel *chan;                  /* ring buffer channel */
 
        /* output from lib_ring_buffer_reserve() */
        int reserve_cpu;                        /* processor id updated by the reserve */
@@ -181,14 +182,22 @@ struct lttng_kernel_ring_buffer_ctx_private {
                                                 * prior to record header alignment
                                                 * padding.
                                                 */
-       u64 tsc;                                /* time-stamp counter value */
+       u64 timestamp;                          /* time-stamp counter value */
        unsigned int rflags;                    /* reservation flags */
 
-       struct lib_ring_buffer *buf;            /*
+       struct lttng_kernel_ring_buffer *buf;   /*
                                                 * buffer corresponding to processor id
                                                 * for this channel
                                                 */
-       struct lib_ring_buffer_backend_pages *backend_pages;
+       struct lttng_kernel_ring_buffer_backend_pages *backend_pages;
+
+       /*
+        * Records lost counts are only loaded into these fields before
+        * reserving the last bytes from the ring buffer.
+        */
+       unsigned long records_lost_full;
+       unsigned long records_lost_wrap;
+       unsigned long records_lost_big;
 };
 
 /*
@@ -198,7 +207,7 @@ struct lttng_kernel_ring_buffer_ctx_private {
  * lib_ring_buffer_try_discard_reserve(), lib_ring_buffer_align_ctx() and
  * lib_ring_buffer_write().
  */
-struct lib_ring_buffer_ctx {
+struct lttng_kernel_ring_buffer_ctx {
        /* Private ring buffer context, set by reserve callback. */
        struct lttng_kernel_ring_buffer_ctx_private priv;
 
@@ -210,7 +219,7 @@ struct lib_ring_buffer_ctx {
                                         * alignment of the largest element
                                         * in the payload
                                         */
-       struct lttng_probe_ctx *probe_ctx;      /* Probe context */
+       struct lttng_kernel_probe_ctx *probe_ctx;       /* Probe context */
 };
 
 /**
@@ -221,10 +230,10 @@ struct lib_ring_buffer_ctx {
  * @largest_align: largest alignment within data payload types
  */
 static inline
-void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx,
+void lib_ring_buffer_ctx_init(struct lttng_kernel_ring_buffer_ctx *ctx,
                              void *client_priv,
                              size_t data_size, int largest_align,
-                             struct lttng_probe_ctx *probe_ctx)
+                             struct lttng_kernel_probe_ctx *probe_ctx)
 {
        ctx->client_priv = client_priv;
        ctx->data_size = data_size;
@@ -235,18 +244,18 @@ void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx,
 /*
  * Reservation flags.
  *
- * RING_BUFFER_RFLAG_FULL_TSC
+ * RING_BUFFER_RFLAG_FULL_TIMESTAMP
  *
  * This flag is passed to record_header_size() and to the primitive used to
  * write the record header. It indicates that the full 64-bit time value is
  * needed in the record header. If this flag is not set, the record header needs
- * only to contain "tsc_bits" bit of time value.
+ * only to contain "timestamp_bits" bit of time value.
  *
  * Reservation flags can be added by the client, starting from
  * "(RING_BUFFER_FLAGS_END << 0)". It can be used to pass information from
  * record_header_size() to lib_ring_buffer_write_record_header().
  */
-#define        RING_BUFFER_RFLAG_FULL_TSC              (1U << 0)
+#define        RING_BUFFER_RFLAG_FULL_TIMESTAMP        (1U << 0)
 #define RING_BUFFER_RFLAG_END                  (1U << 1)
 
 #ifndef LTTNG_TRACER_CORE_H
@@ -294,7 +303,7 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type)
  * @ctx: ring buffer context.
  */
 static inline
-void lib_ring_buffer_align_ctx(struct lib_ring_buffer_ctx *ctx,
+void lib_ring_buffer_align_ctx(struct lttng_kernel_ring_buffer_ctx *ctx,
                           size_t alignment)
 {
        ctx->priv.buf_offset += lib_ring_buffer_align(ctx->priv.buf_offset,
@@ -306,7 +315,7 @@ void lib_ring_buffer_align_ctx(struct lib_ring_buffer_ctx *ctx,
  * Used internally to check for valid configurations at channel creation.
  */
 static inline
-int lib_ring_buffer_check_config(const struct lib_ring_buffer_config *config,
+int lib_ring_buffer_check_config(const struct lttng_kernel_ring_buffer_config *config,
                             unsigned int switch_timer_interval,
                             unsigned int read_timer_interval)
 {
This page took 0.032168 seconds and 4 git commands to generate.