Disable block layer tracing support for kernels < 2.6.38
[lttng-modules.git] / probes / lttng-events.h
index 63bde18533a713df3d939ebbd98607e17861d64c..0c8ae0c761b729ef2a6a9ee0a66cc71838b29092 100644 (file)
@@ -111,6 +111,10 @@ void trace_##_name(void *__data);
 #define __field_ext(_type, _item, _filter_type)                        \
        __field(_type, _item)
 
+#undef __field_hex
+#define __field_hex(_type, _item)                              \
+       __field_full(_type, _item, __BYTE_ORDER, 16)
+
 #undef __field_network
 #define __field_network(_type, _item)                          \
        __field_full(_type, _item, __BIG_ENDIAN, 10)
@@ -184,6 +188,10 @@ void trace_##_name(void *__data);
                },                                              \
        },
 
+#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 */
 
@@ -200,8 +208,6 @@ void trace_##_name(void *__data);
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
-#undef __type_integer
-
 /*
  * Stage 3 of the trace events.
  *
@@ -334,6 +340,11 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
 #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
 
@@ -381,6 +392,9 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \
 #undef __string
 #define __string(_item, _src)
 
+#undef __string_from_user
+#define __string_from_user(_item, _src)
+
 #undef TP_PROTO
 #define TP_PROTO(args...) args
 
@@ -422,7 +436,11 @@ static inline size_t __event_get_align__##_name(_proto)                          \
        _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
@@ -471,6 +489,10 @@ __end_field_##_item##_2:
        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().
@@ -509,6 +531,26 @@ __assign_##dest##_2:                                                       \
                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:                                                \
+       if (0)                                                          \
+               (void) __typemap.dest;                                  \
+       lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest)); \
+       __chan->ops->event_write_from_user(&__ctx, src, len);           \
+       goto __end_field_##dest;
+
+#undef tp_copy_string_from_user
+#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,                 \
+               __get_dynamic_array_len(dest) - 1);                     \
+       __chan->ops->event_memset(&__ctx, 0, 1);                        \
+       goto __end_field_##dest;
+
 #undef tp_strcpy
 #define tp_strcpy(dest, src)                                           \
        tp_memcpy(dest, src, __get_dynamic_array_len(dest))
@@ -642,3 +684,7 @@ module_exit_eval(__lttng_events_exit__, TRACE_SYSTEM);
 #undef module_exit_eval
 #undef TP_ID1
 #undef TP_ID
+
+#undef TP_PROTO
+#undef TP_ARGS
+#undef TRACE_EVENT_FLAGS
This page took 0.025095 seconds and 4 git commands to generate.