From e73784f2f4fb998ff72a604b96e38122b998be60 Mon Sep 17 00:00:00 2001 From: Oussama El Mfadli Date: Wed, 12 May 2010 16:12:42 -0400 Subject: [PATCH] test for two markers on the same line --- configure.ac | 1 + tests/Makefile.am | 2 +- tests/runtests | 8 ++++++++ tests/same_line_marker/Makefile.am | 8 ++++++++ tests/same_line_marker/run | 3 +++ tests/same_line_marker/same_line_marker.c | 24 +++++++++++++++++++++++ 6 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/same_line_marker/Makefile.am create mode 100755 tests/same_line_marker/run create mode 100644 tests/same_line_marker/same_line_marker.c diff --git a/configure.ac b/configure.ac index 7b93653..01d878e 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,7 @@ AC_CONFIG_FILES([ tests/test-nevents/Makefile tests/test-libustinstr-malloc/Makefile tests/dlopen/Makefile + tests/same_line_marker/Makefile libustinstr-malloc/Makefile libustfork/Makefile ustd/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index cb00b56..c1fc928 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen +SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker dist_noinst_SCRIPTS = test_loop runtests trace_matches diff --git a/tests/runtests b/tests/runtests index 40f7528..676ab11 100755 --- a/tests/runtests +++ b/tests/runtests @@ -116,6 +116,14 @@ trace_loc=$(usttrace -W) NOFAIL $MATCHES -N "from_library" -n 1 "^ust.from_library:" $trace_loc NOFAIL $MATCHES -N "from_main_before_lib" -n 1 "^ust.from_main_before_lib:" $trace_loc NOFAIL $MATCHES -N "from_main_after_lib" -n 1 "^ust.from_main_after_lib:" $trace_loc + +### same-line-marker ### +starttest "same_line_marker" +NOFAIL usttrace $TESTDIR/same_line_marker/same_line_marker +trace_loc=$(usttrace -W) +NOFAIL $MATCHES -N "same_line_event" -n 2 "^ust.same_line_event:" $trace_loc + + echo "************************************" echo "$0: All passed" echo "************************************" diff --git a/tests/same_line_marker/Makefile.am b/tests/same_line_marker/Makefile.am new file mode 100644 index 0000000..d1757b1 --- /dev/null +++ b/tests/same_line_marker/Makefile.am @@ -0,0 +1,8 @@ +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 new file mode 100755 index 0000000..9a918f7 --- /dev/null +++ b/tests/same_line_marker/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100644 index 0000000..d9c0f22 --- /dev/null +++ b/tests/same_line_marker/same_line_marker.c @@ -0,0 +1,24 @@ +/* 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 + +int main() +{ + trace_mark(ust, same_line_event, "%s","An event occured in the same line"); trace_mark(ust, same_line_event, "%s","An event occured in the same line"); + return 0; +} -- 2.34.1