Add ctf_sequence_hex() macro
[deliverable/lttng-ust.git] / include / lttng / ust-tracepoint-event.h
index 88953108e65506573dc6740e54ab69f7323fdd1a..d9aa6ce6bdb8f8496b7b7a1dc41facf20ca6a169 100644 (file)
@@ -165,8 +165,9 @@ static const char                                                   \
        },
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src,      \
-                       _length_type, _src_length, _encoding, _nowrite) \
+#define _ctf_sequence_encoded(_type, _item, _src,              \
+                       _length_type, _src_length, _encoding, _nowrite, \
+                       _elem_type_base)                        \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -177,7 +178,7 @@ static const char                                                   \
                          .sequence =                           \
                                {                               \
                                  .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \
-                                 .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
+                                 .elem_type = __type_integer(_type, BYTE_ORDER, _elem_type_base, _encoding), \
                                },                              \
                        },                                      \
                },                                              \
@@ -254,8 +255,8 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
        __event_len += sizeof(_type) * (_length);
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type,        \
-                       _src_length, _encoding, _nowrite)       \
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                         \
+                       _src_length, _encoding, _nowrite, _elem_type_base)       \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type));   \
        __event_len += sizeof(_length_type);                                   \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
@@ -385,28 +386,28 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
                const void *__ctf_tmp_ptr = (_src);                            \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _length_type,                       \
-                       _src_length, _encoding, _nowrite)                      \
+                       _src_length, _encoding, _nowrite, _elem_type_base)     \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_src_length); \
                const void *__ctf_tmp_ptr = (_src);                            \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef _ctf_string
 #define _ctf_string(_item, _src, _nowrite)                                    \
        {                                                                      \
                const void *__ctf_tmp_ptr = (_src);                            \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef TP_ARGS
@@ -451,8 +452,8 @@ void __event_prepare_filter_stack__##_provider##___##_name(char *__stack_data,\
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type,        \
-                       _src_length, _encoding, _nowrite)       \
+#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                       \
+                       _src_length, _encoding, _nowrite, _elem_type_base)     \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_length_type));    \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
@@ -514,7 +515,7 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _length_type,                \
-                       _src_length, _encoding, _nowrite)               \
+                       _src_length, _encoding, _nowrite, _elem_type_base) \
        {                                                               \
                _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx]; \
                lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
@@ -565,6 +566,13 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
 #define _TP_SESSION_CHECK(session, csession)   1
 #endif /* TP_SESSION_CHECK */
 
+#undef _TP_IP_PARAM
+#ifdef TP_IP_PARAM
+#define _TP_IP_PARAM(x)                (x)
+#else /* TP_IP_PARAM */
+#define _TP_IP_PARAM(x)                __builtin_return_address(0)
+#endif /* TP_IP_PARAM */
+
 /*
  * Using twice size for filter stack data to hold size and pointer for
  * each field (worse case). For integers, max size required is 64-bit.
@@ -621,7 +629,7 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))           \
        __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
        lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len,  \
                                 __event_align, -1, __chan->handle);          \
-       __ctx.ip = __builtin_return_address(0);                               \
+       __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM);                                 \
        __ret = __chan->ops->event_reserve(&__ctx, __event->id);              \
        if (__ret < 0)                                                        \
                return;                                                       \
This page took 0.026752 seconds and 5 git commands to generate.