From 18fe792d3d69911e84224ac18afc701b69e368fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 20 Feb 2013 15:36:51 -0500 Subject: [PATCH] Remove outdated dlopen test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Using dlopen to load the tracepoint providers is now discouraged as specified in the lttng-ust man page. Signed-off-by: Jérémie Galarneau --- .gitignore | 1 - tests/dlopen/Makefile.am | 19 -------------- tests/dlopen/dlopen.c | 54 ---------------------------------------- tests/dlopen/dlopen.sh | 34 ------------------------- tests/dlopen/libdummy.c | 23 ----------------- tests/dlopen/run | 3 --- tests/runtests | 2 -- 7 files changed, 136 deletions(-) delete mode 100644 tests/dlopen/Makefile.am delete mode 100644 tests/dlopen/dlopen.c delete mode 100755 tests/dlopen/dlopen.sh delete mode 100644 tests/dlopen/libdummy.c delete mode 100755 tests/dlopen/run diff --git a/.gitignore b/.gitignore index 41a2f020..c34870a6 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,6 @@ ust-consumerd/ust-consumerd tests/daemon/daemon tests/demo/demo -tests/dlopen/dlopen tests/exit-fast/exit-fast tests/fork/fork tests/fork/fork2 diff --git a/tests/dlopen/Makefile.am b/tests/dlopen/Makefile.am deleted file mode 100644 index de05346c..00000000 --- a/tests/dlopen/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -noinst_PROGRAMS = dlopen -noinst_LTLIBRARIES = libdummy.la -libdummy_la_SOURCES = libdummy.c -libdummy_la_LIBADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o -libdummy_la_LDFLAGS = -rpath /nowhere -dlopen_SOURCES = dlopen.c -dlopen_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o - -if LTTNG_UST_BUILD_WITH_LIBDL -dlopen_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -dlopen_LDADD += -lc -endif - -noinst_SCRIPTS = run -EXTRA_DIST = run diff --git a/tests/dlopen/dlopen.c b/tests/dlopen/dlopen.c deleted file mode 100644 index ae209028..00000000 --- a/tests/dlopen/dlopen.c +++ /dev/null @@ -1,54 +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 - */ - -/* The aim of this test is to verify whether ust behaves correctly when - * tracing a marker that is in a dlopen()'d library. It also checks the - * library can be unloaded. - */ - -#include -#include -#include - -int main() -{ - int (*fptr)(); - - ust_marker(from_main_before_lib, "%s", "Event occured in the main program before" - " the opening of the library\n"); - void *lib_handle = dlopen("libdummy.so", RTLD_LAZY); - - if (lib_handle == NULL) { - fprintf(stderr, "%s\n", dlerror()); - return 1; - } - - fptr = (int (*)())dlsym(lib_handle, "exported_function"); - - if ( fptr == NULL) { - fprintf(stderr, "%s\n", dlerror()); - return 1; - } - - (*fptr)(); - dlclose(lib_handle); - - ust_marker(from_main_after_lib,"%s", "Event occured in the main program after " - "the library has been closed\n"); - - return 0; -} diff --git a/tests/dlopen/dlopen.sh b/tests/dlopen/dlopen.sh deleted file mode 100755 index 673fdbc9..00000000 --- a/tests/dlopen/dlopen.sh +++ /dev/null @@ -1,34 +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 "dlopen" - -plan_tests 4 -USTTRACE="$TESTDIR/../usttrace" - -LD_LIBRARY_PATH=$TESTDIR/dlopen/.libs okx $USTTRACE -L $TESTDIR/dlopen/dlopen -trace_loc=$($USTTRACE -W) -trace_matches -N "from_library" -n 1 "^ust.from_library:" $trace_loc -trace_matches -N "from_main_before_lib" -n 1 "^ust.from_main_before_lib:" $trace_loc -trace_matches -N "from_main_after_lib" -n 1 "^ust.from_main_after_lib:" $trace_loc diff --git a/tests/dlopen/libdummy.c b/tests/dlopen/libdummy.c deleted file mode 100644 index dd694c28..00000000 --- a/tests/dlopen/libdummy.c +++ /dev/null @@ -1,23 +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 - -void exported_function() -{ - ust_marker(from_library, "%s", "Event occured in library function"); -} diff --git a/tests/dlopen/run b/tests/dlopen/run deleted file mode 100755 index eabab27f..00000000 --- a/tests/dlopen/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=./.libs $1 ./dlopen diff --git a/tests/runtests b/tests/runtests index e669210e..de8b25a3 100755 --- a/tests/runtests +++ b/tests/runtests @@ -39,8 +39,6 @@ simple_harness_run ./manual_mode_tracing.sh simple_harness_run ./valgrind_ust-consumerd.sh -simple_harness_run dlopen/dlopen.sh - simple_harness_run same_line_marker/same_line_marker.sh # This testcase is currently broken, do not run. -- 2.34.1