Add missing memcpy callback
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Sep 2011 12:15:29 +0000 (08:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Sep 2011 12:15:29 +0000 (08:15 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-events.h
ltt-ring-buffer-client.h
ltt-ring-buffer-metadata-client.h
probes/lttng-events.h

index 586608b38ebda0aff48038c28ade69f322926860..ccb9df829094f60ad9c7b4a20adf7cae421b96b5 100644 (file)
@@ -212,6 +212,8 @@ struct ltt_channel_ops {
                            size_t len);
        void (*event_write_from_user)(struct lib_ring_buffer_ctx *ctx,
                                      const void *src, size_t len);
+       void (*event_memset)(struct lib_ring_buffer_ctx *ctx,
+                            int c, size_t len);
        /*
         * packet_avail_size returns the available size in the current
         * packet. Note that the size returned is only a hint, since it
index f71047f1a999e0f2971fdd827cf6df08aa19965a..8df37901095aade13f6281945ba9d32b5f940653 100644 (file)
@@ -487,6 +487,13 @@ void ltt_event_write_from_user(struct lib_ring_buffer_ctx *ctx,
        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)
 {
@@ -527,6 +534,7 @@ static struct ltt_transport ltt_relay_transport = {
                .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_writer_buf_wait_queue = ltt_get_writer_buf_wait_queue,
                .get_hp_wait_queue = ltt_get_hp_wait_queue,
index 3cf8a342052e2e53e5a2d73cee12f281fa8be69a..529bbb19ffe72dce2897167b18bfaa781945e516 100644 (file)
@@ -231,6 +231,13 @@ void ltt_event_write_from_user(struct lib_ring_buffer_ctx *ctx,
        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
 size_t ltt_packet_avail_size(struct channel *chan)
                             
@@ -287,6 +294,7 @@ static struct ltt_transport ltt_relay_transport = {
                .event_reserve = ltt_event_reserve,
                .event_commit = ltt_event_commit,
                .event_write_from_user = ltt_event_write_from_user,
+               .event_memset = ltt_event_memset,
                .event_write = ltt_event_write,
                .packet_avail_size = ltt_packet_avail_size,
                .get_writer_buf_wait_queue = ltt_get_writer_buf_wait_queue,
index 084666d56514520f7db875e6026bf538eef0cfbd..219f63e6a7fcb01e5d1862c6d8e83f7f33b1ff00 100644 (file)
@@ -510,6 +510,7 @@ __assign_##dest##_2:                                                        \
        __chan->ops->event_write(&__ctx, src,                           \
                sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\
        goto __end_field_##dest##_2;
+
 #undef tp_memcpy_from_user
 #define tp_memcpy_from_user(dest, src, len)                            \
        __assign_##dest:                                                \
@@ -518,17 +519,15 @@ __assign_##dest##_2:                                                      \
        lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest)); \
        __chan->ops->event_write_from_user(&__ctx, src, len);           \
        goto __end_field_##dest;
-/*
- * tp_copy_string_from_user "len" parameter is the length of the string
- * excluding the final \0.
- */
+
 #undef tp_copy_string_from_user
-#define tp_copy_string_from_user(dest, src, len)                       \
+#define tp_copy_string_from_user(dest, src)                            \
        __assign_##dest:                                                \
        if (0)                                                          \
                (void) __typemap.dest;                                  \
        lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest)); \
-       __chan->ops->event_write_from_user(&__ctx, src, len);           \
+       __chan->ops->event_write_from_user(&__ctx, src,                 \
+               __get_dynamic_array_len(dest) - 1);                     \
        __chan->ops->event_memset(&__ctx, 0, 1);                        \
        goto __end_field_##dest;
 
This page took 0.033043 seconds and 4 git commands to generate.