tests/trace_event/trace_event_test
tests/tracepoint/benchmark/tracepoint_benchmark
tests/tracepoint/tracepoint_test
+tests/exit-fast/exit-fast
tests/tracepoint/benchmark/Makefile
tests/register_test/Makefile
tests/libustctl_function_tests/Makefile
+ tests/exit-fast/Makefile
libustinstr-malloc/Makefile
libustfork/Makefile
libustconsumer/Makefile
-SUBDIRS = . hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker trace_event register_test tracepoint libustctl_function_tests
+SUBDIRS = . hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker trace_event register_test tracepoint libustctl_function_tests exit-fast
dist_noinst_SCRIPTS = test_loop runtests trace_matches
--- /dev/null
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+noinst_PROGRAMS = exit-fast
+exit_fast_SOURCES = exit-fast.c
+exit_fast_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
--- /dev/null
+/* Copyright (C) 2011 Nils Carlson
+ *
+ * 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
+ */
+
+/* This test generates a single event and exits.
+ */
+
+#include <signal.h>
+#include <string.h>
+#include <ust/ust.h>
+
+int main(int argc, char *argv[])
+{
+ int suicide = 0;
+
+ if (argc > 1 && !strcmp(argv[1], "suicide")) {
+ suicide = 1;
+ }
+
+ ust_marker(fast, "%d", 0xf330);
+
+ if (suicide) {
+ kill(getpid(), SIGKILL);
+ }
+ return 0;
+}
--- /dev/null
+#!/bin/bash
+#
+# Copyright 2011 Ericsson AB
+#
+# This file is part of the UST test-suite.
+#
+# The UST test-suite 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 2 of the License, or
+# (at your option) any later version.
+#
+# The UST test-suite 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 the UST test-suite. If not, see <http://www.gnu.org/licenses/>.
+
+TESTDIR=$(dirname $0)/..
+
+source $TESTDIR/test_functions.sh
+source $TESTDIR/tap.sh
+
+starttest "Exit-Fast"
+
+plan_tests 6
+USTTRACE="$TESTDIR/../usttrace"
+
+diag "#"
+diag "First run, normal exit"
+diag "#"
+
+okx $USTTRACE -L $TESTDIR/exit-fast/exit-fast
+trace_loc=$($USTTRACE -W)
+trace_matches -N "fast" -n 1 "^ust.fast:" $trace_loc
+check_trace_logs "$trace_loc"
+
+diag "#"
+diag "Re-running, killing process"
+diag "#"
+
+okx $USTTRACE -L $TESTDIR/exit-fast/exit-fast suicide
+trace_loc=$($USTTRACE -W)
+trace_matches -N "fast" -n 1 "^ust.fast:" $trace_loc
+check_trace_logs "$trace_loc"
simple_harness_run libustctl_function_tests/libustctl_function_tests
+simple_harness_run exit-fast/exit-fast.sh
+
echo "************************************"
if [[ $tests_failed -eq 0 ]]; then
echo "$0: All passed"