}, \
},
+#undef __string_from_user
+#define __string_from_user(_item, _src) \
+ __string(_item, _src)
+
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args /* Only one used in this phase */
#define __string(_item, _src) \
__event_len += __dynamic_len[__dynamic_len_idx++] = strlen(_src) + 1;
+/* strlen_user includes \0 */
+#undef __string_from_user
+#define __string_from_user(_item, _src) \
+ __event_len += __dynamic_len[__dynamic_len_idx++] = strlen_user(_src);
+
#undef TP_PROTO
#define TP_PROTO(args...) args
#undef __string
#define __string(_item, _src)
+#undef __string_from_user
+#define __string_from_user(_item, _src)
+
#undef TP_PROTO
#define TP_PROTO(args...) args
_type _item;
#undef __string
-#define __string(_item, _src) char _item;
+#define __string(_item, _src) char _item;
+
+#undef __string_from_user
+#define __string_from_user(_item, _src) \
+ __string(_item, _src)
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args
goto __assign_##_item; \
__end_field_##_item:
+#undef __string_from_user
+#define __string_from_user(_item, _src) \
+ __string(_item, _src)
+
/*
* Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to
* strcpy().
__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: \
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;