From: Mathieu Desnoyers Date: Wed, 10 Aug 2011 18:17:33 +0000 (-0400) Subject: Tracepoint event test update X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=41aaf8a5de3c7c3570e0fe063f1565385b4a4dbd;p=ust.git Tracepoint event test update Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust/lttng-tracepoint-event.h b/include/ust/lttng-tracepoint-event.h index 70d7c65..010a54d 100644 --- a/include/ust/lttng-tracepoint-event.h +++ b/include/ust/lttng-tracepoint-event.h @@ -279,7 +279,7 @@ static struct lttng_probe_desc TP_ID(__probe_desc___, TRACEPOINT_SYSTEM) = { __event_len += sizeof(_type); #undef ctf_array_encoded -#define ctf_array_encoded(_type, _item, _src, _length) \ +#define ctf_array_encoded(_type, _item, _src, _length, _encoding) \ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ __event_len += sizeof(_type) * (_length); @@ -351,7 +351,7 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len) \ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type)); #undef ctf_array_encoded -#define ctf_array_encoded(_type, _item, _src, _length) \ +#define ctf_array_encoded(_type, _item, _src, _length, _encoding) \ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type)); #undef ctf_sequence_encoded @@ -421,7 +421,7 @@ static inline size_t __event_get_align__##_name(void) \ } #undef ctf_array_encoded -#define ctf_array_encoded(_type, _item, _src, _length) \ +#define ctf_array_encoded(_type, _item, _src, _length, _encoding) \ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_type)); \ __chan->ops->event_write(&ctx, _src, _length); diff --git a/tests/hello/hello.c b/tests/hello/hello.c index d30901a..afa4a71 100644 --- a/tests/hello/hello.c +++ b/tests/hello/hello.c @@ -26,8 +26,7 @@ #include #include -#include "usterr.h" -#include "tp.h" +#include "ust_tests_hello.h" void inthandler(int sig) { @@ -42,7 +41,7 @@ int init_int_handler(void) result = sigemptyset(&act.sa_mask); if (result == -1) { - PERROR("sigemptyset"); + perror("sigemptyset"); return -1; } @@ -54,7 +53,7 @@ int init_int_handler(void) */ result = sigaction(SIGUSR1, &act, NULL); if (result == -1) { - PERROR("sigaction"); + perror("sigaction"); return -1; } diff --git a/tests/hello/tp.c b/tests/hello/tp.c index a9ea5dc..509f5a4 100644 --- a/tests/hello/tp.c +++ b/tests/hello/tp.c @@ -19,4 +19,4 @@ */ #define TRACEPOINT_CREATE_PROBES -#include "tp.h" +#include "ust_tests_hello.h" diff --git a/tests/hello/tp.h b/tests/hello/tp.h deleted file mode 100644 index b6b3ff2..0000000 --- a/tests/hello/tp.h +++ /dev/null @@ -1,48 +0,0 @@ -#undef TRACEPOINT_SYSTEM -#define TRACEPOINT_SYSTEM tp - -#if !defined(_TRACEPOINT_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_TP_H - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -TRACEPOINT_EVENT(ust_tests_hello_tptest, - TP_PROTO(int anint), - TP_ARGS(anint), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield, anint) - ctf_integer_network(int, intfield, anint) - ctf_integer_network_hex(int, intfield, anint) - )) - -TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler, - TP_FIELDS()) - -#endif /* _TRACEPOINT_TP_H */ - -#undef TRACEPOINT_INCLUDE_PATH -#define TRACEPOINT_INCLUDE_PATH . -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE tp - -/* This part must be outside protection */ -#include diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h new file mode 100644 index 0000000..a4e3296 --- /dev/null +++ b/tests/hello/ust_tests_hello.h @@ -0,0 +1,48 @@ +#undef TRACEPOINT_SYSTEM +#define TRACEPOINT_SYSTEM ust_tests_hello + +#if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _TRACEPOINT_UST_TESTS_HELLO_H + +/* + * Copyright (C) 2011 Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +TRACEPOINT_EVENT(ust_tests_hello_tptest, + TP_PROTO(int anint), + TP_ARGS(anint), + TP_FIELDS( + ctf_integer(int, intfield, anint) + ctf_integer_hex(int, intfield2, anint) + ctf_integer_network(int, intfield3, anint) + ctf_integer_network_hex(int, intfield4, anint) + )) + +TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler, + TP_FIELDS()) + +#endif /* _TRACEPOINT_TP_H */ + +#undef TRACEPOINT_INCLUDE_PATH +#define TRACEPOINT_INCLUDE_PATH . +#undef TRACEPOINT_INCLUDE_FILE +#define TRACEPOINT_INCLUDE_FILE ust_tests_hello + +/* This part must be outside protection */ +#include