From: Mathieu Desnoyers Date: Thu, 11 Aug 2011 23:51:57 +0000 (-0400) Subject: Fix float/double handling X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=513fc97ee8790f552a761f6d99926a567779d4bc;p=ust.git Fix float/double handling Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust/lttng-events.h b/include/ust/lttng-events.h index b15182c..8f1c98d 100644 --- a/include/ust/lttng-events.h +++ b/include/ust/lttng-events.h @@ -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, \ }, \ } \ diff --git a/include/ust/lttng-tracepoint-event.h b/include/ust/lttng-tracepoint-event.h index a83cc54..de145eb 100644 --- a/include/ust/lttng-tracepoint-event.h +++ b/include/ust/lttng-tracepoint-event.h @@ -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) diff --git a/tests/hello/hello.c b/tests/hello/hello.c index 0725163..9cbe149 100644 --- a/tests/hello/hello.c +++ b/tests/hello/hello.c @@ -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; diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h index 9ee132b..0f709cb 100644 --- a/tests/hello/ust_tests_hello.h +++ b/tests/hello/ust_tests_hello.h @@ -26,8 +26,10 @@ 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,