Fix float/double handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 Aug 2011 23:51:57 +0000 (19:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 Aug 2011 23:51:57 +0000 (19:51 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/ust/lttng-events.h
include/ust/lttng-tracepoint-event.h
tests/hello/hello.c
tests/hello/ust_tests_hello.h

index b15182c80f08357c08426f97acb223a788314e9c..8f1c98d32eed261964cb9616aa072032a86c04ca 100644 (file)
@@ -87,7 +87,6 @@ struct lttng_integer_type {
                                - _float_mant_dig(_type),       \
                  .mant_dig = _float_mant_dig(_type),           \
                  .alignment = lttng_alignof(_type) * CHAR_BIT, \
-                 .signedness = lttng_is_signed_type(_type),    \
                  .reverse_byte_order = __BYTE_ORDER != __FLOAT_WORD_ORDER, \
                },                                              \
        }                                                       \
index a83cc545e2d8522db2a3213a1062dc6753ff4d71..de145ebe5b2d2a270a60f24371a7e31fb2813652 100644 (file)
@@ -43,6 +43,8 @@
 #define ctf_integer_network_hex(_type, _item, _src)            \
        ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 16)
 
+/* ctf_float is redefined at each step */
+
 #undef ctf_array
 #define ctf_array(_type, _item, _src, _length)                 \
        ctf_array_encoded(_type, _item, _src, _length, none)
index 0725163645e0e12757db364b9383d1590fb23607..9cbe149bc7465fc09b27b5b36ad4ea5bcbff1d7b 100644 (file)
@@ -66,6 +66,8 @@ int main(int argc, char **argv)
        int i;
        long values[] = { 1, 2, 3 };
        char text[10] = "test";
+       double dbl = 2.0;
+       float flt = 2222.0;
 
        init_int_handler();
 
@@ -75,7 +77,7 @@ int main(int argc, char **argv)
 
        for (i = 0; i < 50; i++) {
                tracepoint(ust_tests_hello_tptest, i, values,
-                          text, strlen(text));
+                          text, strlen(text), dbl, flt);
                usleep(100000);
        }
        return 0;
index 9ee132b7f6ffed2266219be834851a03c41b0632..0f709cb05e9a6576623a1a098d758d43dc5c5296 100644 (file)
 
 TRACEPOINT_EVENT(ust_tests_hello_tptest,
                        TP_PROTO(int anint, long *values,
-                                char *text, size_t textlen),
-                       TP_ARGS(anint, values, text, textlen),
+                                char *text, size_t textlen,
+                                double doublearg, float floatarg),
+                       TP_ARGS(anint, values, text, textlen,
+                               doublearg, floatarg),
                        TP_FIELDS(
                                ctf_integer(int, intfield, anint)
                                ctf_integer_hex(int, intfield2, anint)
@@ -40,6 +42,8 @@ TRACEPOINT_EVENT(ust_tests_hello_tptest,
                                ctf_sequence_text(char, seqfield2, text,
                                             size_t, textlen)
                                ctf_string(stringfield, text)
+                               ctf_float(float, floatfield, floatarg)
+                               ctf_float(double, doublefield, doublearg)
                        ))
 
 TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler,
This page took 0.025817 seconds and 4 git commands to generate.