From: Jérémie Galarneau Date: Thu, 21 Feb 2013 16:50:03 +0000 (-0500) Subject: Remove fork test X-Git-Tag: v2.2.0-rc1~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5007b4de1f322cf1645c4f5224665b19304d845a;p=lttng-ust.git Remove fork test Moved to lttng-tools. Signed-off-by: Jérémie Galarneau --- diff --git a/.gitignore b/.gitignore index ee3b5da9..390bbf22 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,6 @@ ustctl/ustctl ust-consumerd/ust-consumerd tests/exit-fast/exit-fast -tests/fork/fork -tests/fork/fork2 tests/hello/hello tests/hello.cxx/hello tests/same_line_marker/same_line_marker diff --git a/configure.ac b/configure.ac index 937e48d4..eff0d54e 100644 --- a/configure.ac +++ b/configure.ac @@ -285,7 +285,6 @@ AC_CONFIG_FILES([ tests/hello/Makefile tests/hello-static-lib/Makefile tests/hello.cxx/Makefile - tests/fork/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 704c346a..e5c6b899 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = . hello hello-static-lib fork +SUBDIRS = . hello hello-static-lib #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 diff --git a/tests/fork/Makefile.am b/tests/fork/Makefile.am deleted file mode 100644 index a8933668..00000000 --- a/tests/fork/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers - -noinst_PROGRAMS = fork fork2 -fork_SOURCES = fork.c ust_tests_fork.h -fork_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la \ - $(top_builddir)/liblttng-ust-fork/liblttng-ust-fork.la -fork2_SOURCES = fork2.c -fork2_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la \ - $(top_builddir)/liblttng-ust-fork/liblttng-ust-fork.la - -if LTTNG_UST_BUILD_WITH_LIBDL -fork_LDADD += -ldl -fork2_LDADD += -ldl -endif -if LTTNG_UST_BUILD_WITH_LIBC_DL -fork_LDADD += -lc -fork2_LDADD += -lc -endif - -noinst_SCRIPTS = run -EXTRA_DIST = run diff --git a/tests/fork/README b/tests/fork/README deleted file mode 100644 index dd57c1db..00000000 --- a/tests/fork/README +++ /dev/null @@ -1,2 +0,0 @@ -This test checks if tracing works correctly in a child process created by -a fork() call, as well as after an exec() call. diff --git a/tests/fork/fork.c b/tests/fork/fork.c deleted file mode 100644 index 0d290690..00000000 --- a/tests/fork/fork.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2009 Pierre-Marc Fournier - * Copyright (C) 2011 Mathieu Desnoyers - * - * 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 -#include -#include -#include - -#define TRACEPOINT_DEFINE -#define TRACEPOINT_CREATE_PROBES -#include "ust_tests_fork.h" - -int main(int argc, char **argv, char *env[]) -{ - int result; - - if (argc < 2) { - fprintf(stderr, "usage: fork PROG_TO_EXEC\n"); - exit(1); - } - - printf("Fork test program, parent pid is %d\n", getpid()); - tracepoint(ust_tests_fork, before_fork); - - result = fork(); - if (result == -1) { - perror("fork"); - return 1; - } - if (result == 0) { - char *args[] = { "fork2", NULL }; - - printf("Child pid is %d\n", getpid()); - - tracepoint(ust_tests_fork, after_fork_child, getpid()); - - result = execve(argv[1], args, env); - if (result == -1) { - perror("execve"); - return 1; - } - } else { - tracepoint(ust_tests_fork, after_fork_parent); - } - - return 0; -} diff --git a/tests/fork/fork.sh b/tests/fork/fork.sh deleted file mode 100755 index 631c9d52..00000000 --- a/tests/fork/fork.sh +++ /dev/null @@ -1,38 +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 "fork()/exec() test" - -plan_tests 8 -USTTRACE="$TESTDIR/../usttrace" - -okx $USTTRACE -L -f $TESTDIR/fork/.libs/fork $TESTDIR/fork/.libs/fork2 -trace_loc=$($USTTRACE -W) -trace_matches -N "before_fork" "^ust.before_fork:" $trace_loc -trace_matches -N "after_fork_parent" "^ust.after_fork_parent:" $trace_loc -trace_matches -N "after_fork_child" "^ust.after_fork_child:" $trace_loc -trace_matches -N "before_exec" "^ust.before_exec:" $trace_loc -trace_matches -N "potential_exec" "^ust.potential_exec:" $trace_loc -trace_matches -N "after_exec" "^ust.after_exec:" $trace_loc -check_trace_logs "$trace_loc" diff --git a/tests/fork/fork2.c b/tests/fork/fork2.c deleted file mode 100644 index 49baba8a..00000000 --- a/tests/fork/fork2.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2009 Pierre-Marc Fournier - * - * 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 -#include - -#define TRACEPOINT_DEFINE -#define TRACEPOINT_CREATE_PROBES -#include "ust_tests_fork.h" - -int main() -{ - printf("IN FORK2\n"); - - tracepoint(ust_tests_fork, after_exec); - - return 0; -} diff --git a/tests/fork/run b/tests/fork/run deleted file mode 100755 index bda998fc..00000000 --- a/tests/fork/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./fork ./fork2 diff --git a/tests/fork/ust_tests_fork.h b/tests/fork/ust_tests_fork.h deleted file mode 100644 index b8aeb40a..00000000 --- a/tests/fork/ust_tests_fork.h +++ /dev/null @@ -1,60 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_tests_fork - -#if !defined(_TRACEPOINT_UST_TESTS_FORK_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_TESTS_FORK_H - -/* - * 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 -#include - -TRACEPOINT_EVENT(ust_tests_fork, before_fork, - TP_ARGS(), - TP_FIELDS() -) - -TRACEPOINT_EVENT(ust_tests_fork, after_fork_child, - TP_ARGS(pid_t, pid), - TP_FIELDS( - ctf_integer(pid_t, pid, pid) - ) -) - -TRACEPOINT_EVENT(ust_tests_fork, after_fork_parent, - TP_ARGS(), - TP_FIELDS() -) - -TRACEPOINT_EVENT(ust_tests_fork, after_exec, - TP_ARGS(), - TP_FIELDS() -) - -#endif /* _TRACEPOINT_UST_TESTS_FORK_H */ - -#undef TRACEPOINT_INCLUDE -#define TRACEPOINT_INCLUDE "./ust_tests_fork.h" - -/* This part must be outside ifdef protection */ -#include diff --git a/tests/runtests b/tests/runtests index 6a7b6e0e..9c1111f6 100755 --- a/tests/runtests +++ b/tests/runtests @@ -29,8 +29,6 @@ function simple_harness_run() { } -simple_harness_run fork/fork.sh - simple_harness_run test-libustinstr-malloc/test-libustinstr-malloc.sh simple_harness_run ./manual_mode_tracing.sh