Return POLLERR if channel is disabled (error state)
[lttng-modules.git] / ltt-ring-buffer-client.h
index c97b87430eb0eabe79a43e8687567cbddbc7a934..0d8051ece35bd5ec2e42e3641524b1c5c6a993fb 100644 (file)
@@ -186,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;
@@ -237,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 {
@@ -453,9 +455,27 @@ 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 lib_ring_buffer_channel_is_finalized(chan);
+}
+
+static
+int ltt_is_disabled(struct channel *chan)
 {
-       return &chan->chan->read_wait;
+       return lib_ring_buffer_channel_is_disabled(chan);
 }
 
 static struct ltt_transport ltt_relay_transport = {
@@ -471,6 +491,9 @@ 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,
+               .is_disabled = ltt_is_disabled,
        },
 };
 
This page took 0.027367 seconds and 4 git commands to generate.