X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt-ring-buffer-client.h;h=8df37901095aade13f6281945ba9d32b5f940653;hb=786b8312cc69bfd8e12ec956351da3433db26155;hp=904c42eb466b68e8745f1108ad50922460ba4980;hpb=fcf745787bc83653284a78ff9846f2d75ca35a65;p=lttng-modules.git diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index 904c42eb..8df37901 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -208,6 +208,7 @@ void ltt_write_event_header(const struct lib_ring_buffer_config *config, ctx_record(ctx, ltt_chan, ltt_chan->ctx); ctx_record(ctx, ltt_chan, event->ctx); + lib_ring_buffer_align_ctx(ctx, ctx->largest_align); return; @@ -271,6 +272,7 @@ void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config, } ctx_record(ctx, ltt_chan, ltt_chan->ctx); ctx_record(ctx, ltt_chan, event->ctx); + lib_ring_buffer_align_ctx(ctx, ctx->largest_align); } static const struct lib_ring_buffer_config client_config; @@ -479,9 +481,25 @@ void ltt_event_write(struct lib_ring_buffer_ctx *ctx, const void *src, } static -wait_queue_head_t *ltt_get_reader_wait_queue(struct channel *chan) +void ltt_event_write_from_user(struct lib_ring_buffer_ctx *ctx, + const void __user *src, size_t len) { - return &chan->read_wait; + lib_ring_buffer_copy_from_user(&client_config, ctx, src, len); +} + +static +void ltt_event_memset(struct lib_ring_buffer_ctx *ctx, + int c, size_t len) +{ + lib_ring_buffer_memset(&client_config, ctx, c, len); +} + +static +wait_queue_head_t *ltt_get_writer_buf_wait_queue(struct channel *chan, int cpu) +{ + struct lib_ring_buffer *buf = channel_get_ring_buffer(&client_config, + chan, cpu); + return &buf->write_wait; } static @@ -515,8 +533,10 @@ static struct ltt_transport ltt_relay_transport = { .event_reserve = ltt_event_reserve, .event_commit = ltt_event_commit, .event_write = ltt_event_write, + .event_write_from_user = ltt_event_write_from_user, + .event_memset = ltt_event_memset, .packet_avail_size = NULL, /* Would be racy anyway */ - .get_reader_wait_queue = ltt_get_reader_wait_queue, + .get_writer_buf_wait_queue = ltt_get_writer_buf_wait_queue, .get_hp_wait_queue = ltt_get_hp_wait_queue, .is_finalized = ltt_is_finalized, .is_disabled = ltt_is_disabled,