Add CPU hotplug notifier for ltt debugfs ABI, add pollwait exclusive wrapper
[lttng-modules.git] / ltt-ring-buffer-client.h
index 8095eb6e73abf53a242abafc424559f7ddb3f54a..d14297857925b274fcf89222d37895adb97bcd8c 100644 (file)
@@ -134,7 +134,6 @@ unsigned char record_header_size(const struct lib_ring_buffer_config *config,
                        offset += sizeof(uint32_t);     /* id */
                        offset += lib_ring_buffer_align(offset, ltt_alignof(uint64_t));
                        offset += sizeof(uint64_t);     /* timestamp */
-                       
                }
                break;
        default:
@@ -142,7 +141,6 @@ unsigned char record_header_size(const struct lib_ring_buffer_config *config,
        }
        offset += ctx_get_size(offset, event->ctx);
        offset += ctx_get_size(offset, ltt_chan->ctx);
-       offset += ctx_get_size(offset, ltt_chan->session->ctx);
 
        *pre_header_padding = padding;
        return offset - orig_offset;
@@ -188,8 +186,9 @@ void ltt_write_event_header(const struct lib_ring_buffer_config *config,
        case 2: /* large */
        {
                uint32_t timestamp = (uint32_t) ctx->tsc;
+               uint16_t id = event_id;
 
-               lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
+               lib_ring_buffer_write(config, ctx, &id, sizeof(id));
                lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t));
                lib_ring_buffer_write(config, ctx, &timestamp, sizeof(timestamp));
                break;
@@ -200,7 +199,6 @@ void ltt_write_event_header(const struct lib_ring_buffer_config *config,
 
        ctx_record(ctx, ltt_chan, event->ctx);
        ctx_record(ctx, ltt_chan, ltt_chan->ctx);
-       ctx_record(ctx, ltt_chan, ltt_chan->session->ctx);
 
        return;
 
@@ -240,8 +238,9 @@ void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config,
        {
                if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTT_RFLAG_EXTENDED))) {
                        uint32_t timestamp = (uint32_t) ctx->tsc;
+                       uint16_t id = event_id;
 
-                       lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
+                       lib_ring_buffer_write(config, ctx, &id, sizeof(id));
                        lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t));
                        lib_ring_buffer_write(config, ctx, &timestamp, sizeof(timestamp));
                } else {
@@ -262,7 +261,6 @@ void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config,
        }
        ctx_record(ctx, ltt_chan, event->ctx);
        ctx_record(ctx, ltt_chan, ltt_chan->ctx);
-       ctx_record(ctx, ltt_chan, ltt_chan->session->ctx);
 }
 
 static const struct lib_ring_buffer_config client_config;
@@ -405,7 +403,6 @@ static
 void ltt_buffer_read_close(struct lib_ring_buffer *buf)
 {
        lib_ring_buffer_release_read(buf);
-       
 }
 
 static
@@ -458,9 +455,21 @@ void ltt_event_write(struct lib_ring_buffer_ctx *ctx, const void *src,
 }
 
 static
-wait_queue_head_t *ltt_get_reader_wait_queue(struct ltt_channel *chan)
+wait_queue_head_t *ltt_get_reader_wait_queue(struct channel *chan)
+{
+       return &chan->read_wait;
+}
+
+static
+wait_queue_head_t *ltt_get_hp_wait_queue(struct channel *chan)
+{
+       return &chan->hp_wait;
+}
+
+static
+int ltt_is_finalized(struct channel *chan)
 {
-       return &chan->chan->read_wait;
+       return lib_ring_buffer_channel_is_finalized(chan);
 }
 
 static struct ltt_transport ltt_relay_transport = {
@@ -476,6 +485,8 @@ static struct ltt_transport ltt_relay_transport = {
                .event_write = ltt_event_write,
                .packet_avail_size = NULL,      /* Would be racy anyway */
                .get_reader_wait_queue = ltt_get_reader_wait_queue,
+               .get_hp_wait_queue = ltt_get_hp_wait_queue,
+               .is_finalized = ltt_is_finalized,
        },
 };
 
This page took 0.024803 seconds and 4 git commands to generate.