From: Jérémie Galarneau Date: Thu, 21 Feb 2013 18:33:58 +0000 (-0500) Subject: Replace same_line_marker test with same_line_tracepoint X-Git-Tag: v2.2.0-rc1~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=90c098545344aff35dee3e9ca186d9ea3dd75e0f;p=lttng-ust.git Replace same_line_marker test with same_line_tracepoint This new test is up to date and re-enabled strictly as a build test. Signed-off-by: Jérémie Galarneau --- diff --git a/.gitignore b/.gitignore index a09d4641..c7c52008 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/configure.ac b/configure.ac index eff0d54e..06e5ea55 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index e5c6b899..ed3db48c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 - diff --git a/tests/runtests b/tests/runtests index 17570b38..ca454059 100755 --- a/tests/runtests +++ b/tests/runtests @@ -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 index d1757b17..00000000 --- a/tests/same_line_marker/Makefile.am +++ /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 index 9a918f77..00000000 --- a/tests/same_line_marker/run +++ /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 index ef59a2c9..00000000 --- a/tests/same_line_marker/same_line_marker.c +++ /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 - -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 index c3688ede..00000000 --- a/tests/same_line_marker/same_line_marker.sh +++ /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 . - -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 index 00000000..5cb4f36b --- /dev/null +++ b/tests/same_line_tracepoint/Makefile.am @@ -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 index 00000000..55c2e08b --- /dev/null +++ b/tests/same_line_tracepoint/README @@ -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 index 00000000..60f8a75d --- /dev/null +++ b/tests/same_line_tracepoint/same_line_tracepoint.c @@ -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 index 00000000..2517406f --- /dev/null +++ b/tests/same_line_tracepoint/ust_tests_sameline.h @@ -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 + * + * 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 + +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 + +#ifdef __cplusplus +} +#endif