tests: hello-many
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Oct 2018 20:07:56 +0000 (16:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Oct 2018 21:06:37 +0000 (17:06 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
tests/Makefile.am
tests/hello-many/Makefile.am [new file with mode: 0644]
tests/hello-many/README [new file with mode: 0644]
tests/hello-many/hello-many.c [new file with mode: 0644]
tests/hello-many/tp.c [new file with mode: 0644]
tests/hello-many/ust_tests_hello_many.h [new file with mode: 0644]

index 1c89512c626cbc8b01df1daf18c498ce1c34d386..a3e1e238ce47f85596f419928bc3ae86f89e32b1 100644 (file)
@@ -547,6 +547,7 @@ AC_CONFIG_FILES([
        tests/Makefile
        tests/ctf-types/Makefile
        tests/hello/Makefile
+       tests/hello-many/Makefile
        tests/hello.cxx/Makefile
        tests/same_line_tracepoint/Makefile
        tests/snprintf/Makefile
index 935c7546bbb94c2b62eefbf0b4006d321abf8fc8..c8505eb5ff77da7aec5ee633125c575abd09ef14 100644 (file)
@@ -1,5 +1,5 @@
 SUBDIRS = utils hello same_line_tracepoint snprintf benchmark ust-elf \
-               ctf-types test-app-ctx gcc-weak-hidden
+               ctf-types test-app-ctx gcc-weak-hidden hello-many
 
 if CXX_WORKS
 SUBDIRS += hello.cxx
diff --git a/tests/hello-many/Makefile.am b/tests/hello-many/Makefile.am
new file mode 100644 (file)
index 0000000..338b798
--- /dev/null
@@ -0,0 +1,13 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers
+
+noinst_PROGRAMS = hello-many
+hello_many_SOURCES = hello-many.c tp.c ust_tests_hello_many.h
+hello_many_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la
+hello_many_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)
+
+if LTTNG_UST_BUILD_WITH_LIBDL
+hello_many_LDADD += -ldl
+endif
+if LTTNG_UST_BUILD_WITH_LIBC_DL
+hello_many_LDADD += -lc
+endif
diff --git a/tests/hello-many/README b/tests/hello-many/README
new file mode 100644 (file)
index 0000000..a257254
--- /dev/null
@@ -0,0 +1,2 @@
+This is a "hello world" application used to verify that an instrumented
+program which contains more than 30 tracepoints can be built successfully.
diff --git a/tests/hello-many/hello-many.c b/tests/hello-many/hello-many.c
new file mode 100644 (file)
index 0000000..eb1e471
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009  Pierre-Marc Fournier
+ * Copyright (C) 2011  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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; version 2.1 of
+ * the License.
+ *
+ * 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 <stdio.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define TRACEPOINT_DEFINE
+#include "ust_tests_hello_many.h"
+
+int main(int argc, char **argv)
+{
+       int delay = 0;
+
+       if (argc == 2)
+               delay = atoi(argv[1]);
+
+       fprintf(stderr, "Hello, World!\n");
+
+       sleep(delay);
+
+       fprintf(stderr, "Tracing... ");
+       tracepoint(ust_tests_hello_many, tptest_simple1);
+       tracepoint(ust_tests_hello_many, tptest_simple34);
+       fprintf(stderr, " done.\n");
+       return 0;
+}
diff --git a/tests/hello-many/tp.c b/tests/hello-many/tp.c
new file mode 100644 (file)
index 0000000..ed5e8ce
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * tp.c
+ *
+ * Copyright (c) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define TRACEPOINT_CREATE_PROBES
+#include "ust_tests_hello_many.h"
diff --git a/tests/hello-many/ust_tests_hello_many.h b/tests/hello-many/ust_tests_hello_many.h
new file mode 100644 (file)
index 0000000..c5f82b6
--- /dev/null
@@ -0,0 +1,239 @@
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER ust_tests_hello_many
+
+#if !defined(_TRACEPOINT_UST_TESTS_HELLO_MANY_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_UST_TESTS_HELLO_MANY_H
+
+/*
+ * Copyright (C) 2011  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <lttng/tracepoint.h>
+#include <stdbool.h>
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple1,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple2,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple3,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple4,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple5,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple6,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple7,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple8,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple9,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple10,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple11,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple12,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple13,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple14,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple15,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple16,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple17,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple18,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple19,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple20,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple21,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple22,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple23,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple24,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple25,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple26,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple27,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple28,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple29,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple30,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple31,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple32,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple33,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple34,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple35,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple36,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple37,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple38,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple39,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+TRACEPOINT_EVENT(ust_tests_hello_many, tptest_simple40,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+
+#endif /* _TRACEPOINT_UST_TESTS_HELLO_MANY_H */
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./ust_tests_hello_many.h"
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>
This page took 0.029495 seconds and 4 git commands to generate.