Tracepoint: add ctf array for network byte order integers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 6 May 2016 20:09:57 +0000 (16:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 6 May 2016 20:09:57 +0000 (16:09 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-tracepoint-event-nowrite.h
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event-write.h
include/lttng/ust-tracepoint-event.h
tests/hello/ust_tests_hello.h

index 83a9c93ecdb4fc33db4ba368da3a6f16501cf9f5..c0b42665ae4805ed68f7fb2991728f15b0f3c262 100644 (file)
 
 #undef ctf_array_nowrite
 #define ctf_array_nowrite(_type, _item, _src, _length)         \
-       _ctf_array_encoded(_type, _item, _src, _length, none, 1)
+       _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, none, 1, 10)
 
 #undef ctf_array_text_nowrite
 #define ctf_array_text_nowrite(_type, _item, _src, _length)    \
-       _ctf_array_encoded(_type, _item, _src, _length, UTF8, 1)
+       _ctf_array_encoded(_type, _item, _src, BYTE_ORDER, _length, UTF8, 1, 10)
 
 #undef ctf_sequence_nowrite
 #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) \
index 7852bd8b5a102ffdd8ac56d36c584fa925b24d27..a89e6efa70314e1378e3ad0f5774aa2bd5281cdf 100644 (file)
@@ -54,8 +54,8 @@
 #define _ctf_float(_type, _item, _src, _nowrite)
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, \
-                       _nowrite)
+#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, _encoding, \
+                       _nowrite, _elem_type_base)
 
 #undef _ctf_sequence_encoded
 #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \
index faf26e2c0ced9fa0b7e3159f49c1399dd591bc4a..0d4cf6844a5f4a8cdaa8b633d5c092b6eedc7d76 100644 (file)
 
 #undef ctf_array
 #define ctf_array(_type, _item, _src, _length)                 \
-       _ctf_array_encoded(_type, _item, _src, _length, none, 0)
+       _ctf_array_encoded(_type, _item, _src, BYTE_ORDER,      \
+                       _length, none, 0, 10)
+
+#undef ctf_array_hex
+#define ctf_array_hex(_type, _item, _src, _length)             \
+       _ctf_array_encoded(_type, _item, _src, BYTE_ORDER,      \
+                       _length, none, 0, 16)
+
+#undef ctf_array_network
+#define ctf_array_network(_type, _item, _src, _length) \
+       _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN,      \
+                       _length, none, 0, 10)
+
+#undef ctf_array_network_hex
+#define ctf_array_network_hex(_type, _item, _src, _length)     \
+       _ctf_array_encoded(_type, _item, _src, BIG_ENDIAN,      \
+                       _length, none, 0, 16)
 
 #undef ctf_array_text
 #define ctf_array_text(_type, _item, _src, _length)            \
-       _ctf_array_encoded(_type, _item, _src, _length, UTF8, 0)
+       _ctf_array_encoded(_type, _item, _src, BYTE_ORDER,      \
+                       _length, UTF8, 0, 10)
 
 #undef ctf_sequence
 #define ctf_sequence(_type, _item, _src, _length_type, _src_length) \
index 2b599a889662a562dc553e3019456eedb2e8d1e0..64c453578410ef17d6e62fd643e366a34a49e686 100644 (file)
@@ -202,7 +202,9 @@ static const char                                                   \
        },
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _byte_order,    \
+                       _length, _encoding, _nowrite,           \
+                       _elem_type_base)                        \
        {                                                       \
          .name = #_item,                                       \
          .type =                                               \
@@ -212,7 +214,7 @@ static const char                                                   \
                        {                                       \
                          .array =                              \
                                {                               \
-                                 .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
+                                 .elem_type = __type_integer(_type, _byte_order, _elem_type_base, _encoding), \
                                  .length = _length,            \
                                }                               \
                        }                                       \
@@ -339,7 +341,8 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
        __event_len += sizeof(_type);
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite)     \
+#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, _encoding,         \
+                       _nowrite, _elem_type_base)                               \
        __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
        __event_len += sizeof(_type) * (_length);
 
@@ -486,7 +489,8 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
        }
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite)   \
+#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,          \
+                       _encoding, _nowrite, _elem_type_base)                  \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_length);     \
                const void *__ctf_tmp_ptr = (_src);                            \
@@ -557,7 +561,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_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite)   \
+#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,          \
+                       _encoding, _nowrite, _elem_type_base)                  \
        __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
 
 #undef _ctf_sequence_encoded
@@ -622,7 +627,8 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
        }
 
 #undef _ctf_array_encoded
-#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite) \
+#define _ctf_array_encoded(_type, _item, _src, _byte_order, _length,   \
+                       _encoding, _nowrite, _elem_type_base)           \
        lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type));        \
        __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length));
 
index 84a799a05d32946e8b0e92b33158a55539041c9d..ec5c00cd378b9773421738d2a10012aa6365f57b 100644 (file)
@@ -41,9 +41,14 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest,
                ctf_integer_network(int, netintfield, netint)
                ctf_integer_network_hex(int, netintfieldhex, netint)
                ctf_array(long, arrfield1, values, 3)
+               ctf_array_hex(long, arrfield1_hex, values, 3)
+               ctf_array_network(long, arrfield1_network, values, 3)
+               ctf_array_network_hex(long, arrfield1_network_hex, values, 3)
                ctf_array_text(char, arrfield2, text, 10)
                ctf_sequence(char, seqfield1, text,
                             size_t, textlen)
+               ctf_sequence_hex(char, seqfield1_hex, text,
+                            size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
                             size_t, textlen)
                ctf_sequence_network(long, seqfield_network_3, values,
This page took 0.028247 seconds and 4 git commands to generate.