Replace same_line_marker test with same_line_tracepoint
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Feb 2013 18:33:58 +0000 (13:33 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 Mar 2013 15:22:02 +0000 (11:22 -0400)
This new test is up to date and re-enabled strictly as a build test.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
12 files changed:
.gitignore
configure.ac
tests/Makefile.am
tests/runtests
tests/same_line_marker/Makefile.am [deleted file]
tests/same_line_marker/run [deleted file]
tests/same_line_marker/same_line_marker.c [deleted file]
tests/same_line_marker/same_line_marker.sh [deleted file]
tests/same_line_tracepoint/Makefile.am [new file with mode: 0644]
tests/same_line_tracepoint/README [new file with mode: 0644]
tests/same_line_tracepoint/same_line_tracepoint.c [new file with mode: 0644]
tests/same_line_tracepoint/ust_tests_sameline.h [new file with mode: 0644]

index a09d4641a224aeb2aa2945e3eb2728ac66a0b478..c7c52008038cc3bf3b8a18fb287670ff22f1e589 100644 (file)
@@ -33,7 +33,7 @@ ust-consumerd/ust-consumerd
 
 tests/hello/hello
 tests/hello.cxx/hello
-tests/same_line_marker/same_line_marker
+tests/same_line_tracepoint/same_line_tracepoint
 tests/ust-basic-tracing/ust-basic-tracing
 tests/ust-multi-test/ust-multi-test
 tests/trace_event/trace_event_test
index eff0d54e190c8153ee14ae2f77ebc169e2a4be09..06e5ea55ad9b0616170e29c69f92b19a5bdcece3 100644 (file)
@@ -285,6 +285,7 @@ AC_CONFIG_FILES([
        tests/hello/Makefile
        tests/hello-static-lib/Makefile
        tests/hello.cxx/Makefile
+       tests/same_line_tracepoint/Makefile
        tests/ust-basic-tracing/Makefile
        tests/ust-multi-test/Makefile
        lttng-ust.pc
index e5c6b89979a4a3968cb8977a4ac9eee3f724f946..ed3db48c1aa918f8754ad46d69345f69be48b232 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = . hello hello-static-lib
+SUBDIRS = . hello hello-static-lib same_line_tracepoint
 #ust-basic-tracing ust-multi-test
 #SUBDIRS = . hello2 basic basic_long simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker trace_event register_test tracepoint libustctl_function_tests exit-fast
 
@@ -13,4 +13,3 @@ noinst_LIBRARIES = libtap.a
 libtap_a_SOURCES = \
        tap.c \
        tap.h
-
index 17570b380772b88743d6f31a2fb2ea268602c6f8..ca454059f373dc18074dca76a3f4fce6b316bac3 100755 (executable)
@@ -33,8 +33,6 @@ simple_harness_run ./manual_mode_tracing.sh
 
 simple_harness_run ./valgrind_ust-consumerd.sh
 
-simple_harness_run same_line_marker/same_line_marker.sh
-
 # This testcase is currently broken, do not run.
 # simple_harness_run tracepoint/run
 
diff --git a/tests/same_line_marker/Makefile.am b/tests/same_line_marker/Makefile.am
deleted file mode 100644 (file)
index d1757b1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libust
-
-noinst_PROGRAMS = same_line_marker
-same_line_marker_SOURCES = same_line_marker.c
-same_line_marker_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
-
-noinst_SCRIPTS = run
-EXTRA_DIST = run
diff --git a/tests/same_line_marker/run b/tests/same_line_marker/run
deleted file mode 100755 (executable)
index 9a918f7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs $1 ./same_line_marker
diff --git a/tests/same_line_marker/same_line_marker.c b/tests/same_line_marker/same_line_marker.c
deleted file mode 100644 (file)
index ef59a2c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (C) 2010 Oussama El Mfadli, Alexis Hallé
- *
- * 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 <ust/marker.h>
-
-int main()
-{
-       ust_marker(same_line_event, "%s","An event occured in the same line"); ust_marker(same_line_event, "%s","An event occured in the same line");
-       return 0;
-}
diff --git a/tests/same_line_marker/same_line_marker.sh b/tests/same_line_marker/same_line_marker.sh
deleted file mode 100755 (executable)
index c3688ed..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2010 Ericsson AB
-#
-#    This file is part of LTTng-UST.
-#
-#    LTTng-UST is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
-#
-#    LTTng-UST 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 General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with LTTng-UST.  If not, see <http://www.gnu.org/licenses/>.
-
-TESTDIR=$(dirname $0)/..
-
-source $TESTDIR/test_functions.sh
-source $TESTDIR/tap.sh
-
-starttest "same_line_marker"
-
-plan_tests 2
-USTTRACE="$TESTDIR/../usttrace"
-
-okx $USTTRACE -L $TESTDIR/same_line_marker/same_line_marker
-trace_loc=$($USTTRACE -W)
-trace_matches -N "same_line_event" -n 2 "^ust.same_line_event:" $trace_loc
diff --git a/tests/same_line_tracepoint/Makefile.am b/tests/same_line_tracepoint/Makefile.am
new file mode 100644 (file)
index 0000000..5cb4f36
--- /dev/null
@@ -0,0 +1,12 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers
+
+noinst_PROGRAMS = same_line_tracepoint
+same_line_tracepoint_SOURCES = same_line_tracepoint.c ust_tests_sameline.h
+same_line_tracepoint_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la
+
+if LTTNG_UST_BUILD_WITH_LIBDL
+same_line_tracepoint_LDADD += -ldl
+endif
+if LTTNG_UST_BUILD_WITH_LIBC_DL
+same_line_tracepoint_LDADD += -lc
+endif
diff --git a/tests/same_line_tracepoint/README b/tests/same_line_tracepoint/README
new file mode 100644 (file)
index 0000000..55c2e08
--- /dev/null
@@ -0,0 +1,5 @@
+Same line tracepoint test
+-------------------------
+
+This is a build test that verifies multiple tracepoint can be placed on a single
+line.
diff --git a/tests/same_line_tracepoint/same_line_tracepoint.c b/tests/same_line_tracepoint/same_line_tracepoint.c
new file mode 100644 (file)
index 0000000..60f8a75
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright (C) 2013 Jérémie Galarneau
+ *
+ * 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
+ */
+
+#define TRACEPOINT_DEFINE
+#define TRACEPOINT_CREATE_PROBES
+#include "ust_tests_sameline.h"
+
+int main()
+{
+       tracepoint(ust_tests_sameline, event1); tracepoint(ust_tests_sameline, event2);
+       return 0;
+}
diff --git a/tests/same_line_tracepoint/ust_tests_sameline.h b/tests/same_line_tracepoint/ust_tests_sameline.h
new file mode 100644 (file)
index 0000000..2517406
--- /dev/null
@@ -0,0 +1,57 @@
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER ust_tests_sameline
+
+#if !defined(_TRACEPOINT_UST_TESTS_SAMELINE_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_UST_TESTS_SAMELINE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * 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>
+
+TRACEPOINT_EVENT(ust_tests_sameline, event1,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+TRACEPOINT_LOGLEVEL(ust_tests_sameline, event1, TRACE_CRIT)
+
+TRACEPOINT_EVENT(ust_tests_sameline, event2,
+       TP_ARGS(),
+       TP_FIELDS()
+)
+TRACEPOINT_LOGLEVEL(ust_tests_sameline, event2, TRACE_CRIT)
+
+#endif /* _TRACEPOINT_UST_TESTS_SAMELINE_H */
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./ust_tests_sameline.h"
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>
+
+#ifdef __cplusplus
+}
+#endif
This page took 0.034333 seconds and 4 git commands to generate.