Tracepoint: add ctf sequence for network byte order integers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 6 May 2016 18:32:45 +0000 (14:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 6 May 2016 18:32:45 +0000 (14:32 -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 8cb142b2e7ed629b7c81cdada445cfff4eeaad3d..83a9c93ecdb4fc33db4ba368da3a6f16501cf9f5 100644 (file)
 
 #undef ctf_sequence_nowrite
 #define ctf_sequence_nowrite(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
                        _length_type, _src_length, none, 1, 10)
 
 #undef ctf_sequence_nowrite_hex
 #define ctf_sequence_nowrite_hex(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
                        _length_type, _src_length, none, 1, 16)
 
 #undef ctf_sequence_text_nowrite
 #define ctf_sequence_text_nowrite(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
                        _length_type, _src_length, UTF8, 1, 10)
 
 #undef ctf_string_nowrite
index c187061ca67da80a38ec2e6cfb409a09458a2af2..7852bd8b5a102ffdd8ac56d36c584fa925b24d27 100644 (file)
@@ -58,7 +58,7 @@
                        _nowrite)
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type, \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \
                        _src_length, _encoding, _nowrite, _elem_type_base)
 
 #undef _ctf_string
index 444702fceab6a61f4edc200d2651240c9110f6c1..faf26e2c0ced9fa0b7e3159f49c1399dd591bc4a 100644 (file)
 
 #undef ctf_sequence
 #define ctf_sequence(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
                        _length_type, _src_length, none, 0, 10)
 
 #undef ctf_sequence_hex
 #define ctf_sequence_hex(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
+                       _length_type, _src_length, none, 0, 16)
+
+#undef ctf_sequence_network
+#define ctf_sequence_network(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN,   \
+                       _length_type, _src_length, none, 0, 10)
+
+#undef ctf_sequence_network_hex
+#define ctf_sequence_network_hex(_type, _item, _src, _length_type, _src_length) \
+       _ctf_sequence_encoded(_type, _item, _src, BIG_ENDIAN,   \
                        _length_type, _src_length, none, 0, 16)
 
 #undef ctf_sequence_text
 #define ctf_sequence_text(_type, _item, _src, _length_type, _src_length) \
-       _ctf_sequence_encoded(_type, _item, _src,               \
+       _ctf_sequence_encoded(_type, _item, _src, BYTE_ORDER,   \
                        _length_type, _src_length, UTF8, 0, 10)
 
 #undef ctf_string
index e914d97ed002f98dab33761a5607d1ed793b5602..2b599a889662a562dc553e3019456eedb2e8d1e0 100644 (file)
@@ -221,7 +221,7 @@ static const char                                                   \
        },
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src,              \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, \
                        _length_type, _src_length, _encoding, _nowrite, \
                        _elem_type_base)                        \
        {                                                       \
@@ -234,7 +234,7 @@ static const char                                                   \
                          .sequence =                           \
                                {                               \
                                  .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \
-                                 .elem_type = __type_integer(_type, BYTE_ORDER, _elem_type_base, _encoding), \
+                                 .elem_type = __type_integer(_type, _byte_order, _elem_type_base, _encoding), \
                                },                              \
                        },                                      \
                },                                              \
@@ -344,7 +344,7 @@ 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,                         \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _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);                                   \
@@ -497,7 +497,7 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
        }
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                       \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type,   \
                        _src_length, _encoding, _nowrite, _elem_type_base)     \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_src_length); \
@@ -561,7 +561,7 @@ 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,                       \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _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));
@@ -627,7 +627,7 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args))      \
        __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length));
 
 #undef _ctf_sequence_encoded
-#define _ctf_sequence_encoded(_type, _item, _src, _length_type,                \
+#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \
                        _src_length, _encoding, _nowrite, _elem_type_base) \
        {                                                               \
                _length_type __tmpl = __stackvar.__dynamic_len[__dynamic_len_idx]; \
index e518b0d4903499aa93281d01f8c5e9689c09441d..84a799a05d32946e8b0e92b33158a55539041c9d 100644 (file)
@@ -46,6 +46,8 @@ TRACEPOINT_EVENT(ust_tests_hello, tptest,
                             size_t, textlen)
                ctf_sequence_text(char, seqfield2, text,
                             size_t, textlen)
+               ctf_sequence_network(long, seqfield_network_3, values,
+                            size_t, 3)
                ctf_string(stringfield, text)
                ctf_float(float, floatfield, floatarg)
                ctf_float(double, doublefield, doublearg)
This page took 0.029424 seconds and 4 git commands to generate.