Tests: change buffers UID test to PID
authorDavid Goulet <dgoulet@efficios.com>
Tue, 27 Aug 2013 21:30:45 +0000 (17:30 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 27 Aug 2013 21:30:45 +0000 (17:30 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
configure.ac
tests/fast_regression
tests/long_regression
tests/regression/ust/Makefile.am
tests/regression/ust/buffers-pid/Makefile.am [new file with mode: 0644]
tests/regression/ust/buffers-pid/test_buffers_pid [new file with mode: 0755]
tests/regression/ust/buffers-uid/Makefile.am [deleted file]
tests/regression/ust/buffers-uid/test_buffers_uid [deleted file]

index 8d42e90190e95d43e375632d8b2d8637a631ae26..ba3776230fdea64981dd94038184506e730d9cb4 100644 (file)
@@ -376,7 +376,7 @@ AC_CONFIG_FILES([
        tests/regression/ust/high-throughput/Makefile
        tests/regression/ust/low-throughput/Makefile
        tests/regression/ust/before-after/Makefile
-       tests/regression/ust/buffers-uid/Makefile
+       tests/regression/ust/buffers-pid/Makefile
        tests/regression/ust/periodical-metadata-flush/Makefile
        tests/regression/ust/multi-session/Makefile
        tests/regression/ust/overlap/Makefile
index b54d38d0eeb898a26df32ed18eb58d42a1411946..92aaff65c6e95b5951f1c1572be918c79ad78fa7 100644 (file)
@@ -7,7 +7,7 @@ regression/tools/tracefile-limits/test_tracefile_size
 regression/tools/snapshots/test_ust
 regression/tools/snapshots/test_ust_streaming
 regression/ust/before-after/test_before_after
-regression/ust/buffers-uid/test_buffers_uid
+regression/ust/buffers-pid/test_buffers_pid
 regression/ust/periodical-metadata-flush/test_periodical_metadata_flush
 regression/ust/multi-session/test_multi_session
 regression/ust/nprocesses/test_nprocesses
index 246259ab7dd854d932b04391736335c530bb362c..b9d6ef8f71452c8b560c389c51ac0b1db7a57f98 100644 (file)
@@ -8,7 +8,7 @@ regression/tools/streaming/test_ust
 regression/tools/tracefile-limits/test_tracefile_count
 regression/tools/tracefile-limits/test_tracefile_size
 regression/ust/before-after/test_before_after
-regression/ust/buffers-uid/test_buffers_uid
+regression/ust/buffers-pid/test_buffers_pid
 regression/ust/periodical-metadata-flush/test_periodical_metadata_flush
 regression/ust/high-throughput/test_high_throughput
 regression/ust/low-throughput/test_low_throughput
index b3620c008f44d4081422ca85a9ac2aa3b35243a6..e7b4cf71b8f27f0c8f8ead42074c13bcf42db409 100644 (file)
@@ -1,6 +1,6 @@
 if HAVE_LIBLTTNG_UST_CTL
 SUBDIRS = nprocesses high-throughput low-throughput before-after multi-session \
-               overlap buffers-uid linking daemon exit-fast fork libc-wrapper \
+               overlap buffers-pid linking daemon exit-fast fork libc-wrapper \
                periodical-metadata-flush
 
 EXTRA_DIST = test_event_basic test_event_wildcard
diff --git a/tests/regression/ust/buffers-pid/Makefile.am b/tests/regression/ust/buffers-pid/Makefile.am
new file mode 100644 (file)
index 0000000..74aacba
--- /dev/null
@@ -0,0 +1,16 @@
+noinst_SCRIPTS = test_buffers_pid
+EXTRA_DIST = test_buffers_pid
+
+all-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       cp -f $(srcdir)/$$script $(builddir); \
+               done; \
+       fi
+
+clean-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       rm -f $(builddir)/$$script; \
+               done; \
+       fi
diff --git a/tests/regression/ust/buffers-pid/test_buffers_pid b/tests/regression/ust/buffers-pid/test_buffers_pid
new file mode 100755 (executable)
index 0000000..2d227bf
--- /dev/null
@@ -0,0 +1,241 @@
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# 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
+TEST_DESC="UST tracer - Tracing with per PID buffers"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+NR_ITER=100
+NR_USEC_WAIT=100000
+SESSION_NAME="buffers-pid"
+
+TESTAPP_PATH="$TESTDIR/utils/testapp"
+TESTAPP_NAME="gen-ust-events"
+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
+EVENT_NAME="tp:tptest"
+NUM_TESTS=58
+
+source $TESTDIR/utils/utils.sh
+
+if [ ! -x "$TESTAPP_BIN" ]; then
+       BAIL_OUT "No UST events binary detected."
+fi
+
+# MUST set TESTDIR before calling those functions
+
+function enable_channel_per_pid()
+{
+       sess_name=$1
+       channel_name=$2
+
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel --buffers-pid -u $channel_name -s $sess_name >/dev/null 2>&1
+       ok $? "Enable channel $channel_name per PID for session $sess_name"
+}
+
+function wait_apps
+{
+       diag "Waiting for applications to end..."
+       while [ -n "$(pidof $TESTAPP_NAME)" ]; do
+               sleep 1
+       done
+}
+
+test_after_multiple_apps() {
+       local out
+       local i
+
+       diag "Start multiple applications AFTER tracing is started"
+
+       # BEFORE application is spawned
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_channel_per_pid $SESSION_NAME "channel0"
+       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
+       start_lttng_tracing $SESSION_NAME
+
+       for i in `seq 1 5`; do
+               $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
+               ok $? "Start application $i for tracing"
+       done
+       wait_apps
+
+       stop_lttng_tracing $SESSION_NAME
+       destroy_lttng_session $SESSION_NAME
+
+       trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
+
+       return $?
+}
+
+test_before_multiple_apps() {
+       local out
+       local i
+
+       diag "Start multiple applications BEFORE tracing is started"
+
+       for i in `seq 1 5`; do
+               $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
+               ok $? "Start application $i for tracing"
+       done
+
+       # BEFORE application is spawned
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_channel_per_pid $SESSION_NAME "channel0"
+       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
+       start_lttng_tracing $SESSION_NAME
+
+       # At least hit one event
+       sleep 2
+
+       stop_lttng_tracing $SESSION_NAME
+       destroy_lttng_session $SESSION_NAME
+
+       out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
+       if [ $out -eq 0 ]; then
+               fail "Trace validation"
+               diag "No event(s) found. We are supposed to have at least one."
+               out=1
+       else
+               pass "Trace validation"
+               diag "Found $out event(s). Coherent."
+               out=0
+       fi
+
+       wait_apps
+
+       return $out
+}
+
+test_after_app() {
+       local out
+
+       diag "Start application AFTER tracing is started"
+
+       # BEFORE application is spawned
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_channel_per_pid $SESSION_NAME "channel0"
+       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
+       start_lttng_tracing $SESSION_NAME
+
+       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+       ok $? "Start application to trace"
+
+       stop_lttng_tracing $SESSION_NAME
+       destroy_lttng_session $SESSION_NAME
+
+       trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+
+       return $?
+}
+
+test_before_app() {
+       local out
+
+       diag "Start application BEFORE tracing is started"
+
+       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
+       ok $? "Start application to trace"
+
+       # BEFORE application is spawned
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_channel_per_pid $SESSION_NAME "channel0"
+       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
+       start_lttng_tracing $SESSION_NAME
+
+       # At least hit one event
+       sleep 2
+
+       stop_lttng_tracing $SESSION_NAME
+       destroy_lttng_session $SESSION_NAME
+
+       out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
+       if [ $out -eq 0 ]; then
+               fail "Trace validation"
+               diag "No event(s) found. We are supposed to have at least one."
+               out=1
+       else
+               pass "Trace validation"
+               diag "Found $out event(s). Coherent."
+               out=0
+       fi
+
+       wait_apps
+
+       return $out
+}
+
+test_multiple_channels() {
+       local out
+
+       diag "Start with multiple channels"
+
+       # BEFORE application is spawned
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_channel_per_pid $SESSION_NAME "channel0"
+       enable_channel_per_pid $SESSION_NAME "channel1"
+       enable_channel_per_pid $SESSION_NAME "channel2"
+       enable_channel_per_pid $SESSION_NAME "channel3"
+       enable_channel_per_pid $SESSION_NAME "channel4"
+       # Enable event in all channels.
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel0 -s $SESSION_NAME -u >/dev/null 2>&1
+       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel0"
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel1 -s $SESSION_NAME -u >/dev/null 2>&1
+       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel1"
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel2 -s $SESSION_NAME -u >/dev/null 2>&1
+       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel2"
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel3 -s $SESSION_NAME -u >/dev/null 2>&1
+       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel3"
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel4 -s $SESSION_NAME -u >/dev/null 2>&1
+       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel4"
+       start_lttng_tracing $SESSION_NAME
+
+       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+       ok $? "Start application to trace"
+
+       stop_lttng_tracing $SESSION_NAME
+       trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
+       out=$?
+
+       destroy_lttng_session $SESSION_NAME
+
+       return $out
+}
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+TESTS=(
+       "test_before_app"
+       "test_after_app"
+       "test_after_multiple_apps"
+       "test_before_multiple_apps"
+       "test_multiple_channels"
+)
+
+TEST_COUNT=${#TESTS[@]}
+i=0
+
+start_lttng_sessiond
+
+while [ $i -lt $TEST_COUNT ]; do
+       TRACE_PATH=$(mktemp -d)
+       ${TESTS[$i]}
+       rm -rf $TRACE_PATH
+       let "i++"
+done
+
+stop_lttng_sessiond
diff --git a/tests/regression/ust/buffers-uid/Makefile.am b/tests/regression/ust/buffers-uid/Makefile.am
deleted file mode 100644 (file)
index 1925768..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-noinst_SCRIPTS = test_buffers_uid
-EXTRA_DIST = test_buffers_uid
-
-all-local:
-       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
-                       cp -f $(srcdir)/$$script $(builddir); \
-               done; \
-       fi
-
-clean-local:
-       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
-                       rm -f $(builddir)/$$script; \
-               done; \
-       fi
diff --git a/tests/regression/ust/buffers-uid/test_buffers_uid b/tests/regression/ust/buffers-uid/test_buffers_uid
deleted file mode 100755 (executable)
index faeec03..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# 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
-TEST_DESC="UST tracer - Tracing with per UID buffers"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-NR_ITER=100
-NR_USEC_WAIT=100000
-SESSION_NAME="buffers-uid"
-
-TESTAPP_PATH="$TESTDIR/utils/testapp"
-TESTAPP_NAME="gen-ust-events"
-TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
-EVENT_NAME="tp:tptest"
-NUM_TESTS=58
-
-source $TESTDIR/utils/utils.sh
-
-if [ ! -x "$TESTAPP_BIN" ]; then
-       BAIL_OUT "No UST events binary detected."
-fi
-
-# MUST set TESTDIR before calling those functions
-
-function enable_channel_per_uid()
-{
-       sess_name=$1
-       channel_name=$2
-
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel --buffers-uid -u $channel_name -s $sess_name >/dev/null 2>&1
-       ok $? "Enable channel $channel_name per UID for session $sess_name"
-}
-
-function wait_apps
-{
-       diag "Waiting for applications to end..."
-       while [ -n "$(pidof $TESTAPP_NAME)" ]; do
-               sleep 1
-       done
-}
-
-test_after_multiple_apps() {
-       local out
-       local i
-
-       diag "Start multiple applications AFTER tracing is started"
-
-       # BEFORE application is spawned
-       create_lttng_session $SESSION_NAME $TRACE_PATH
-       enable_channel_per_uid $SESSION_NAME "channel0"
-       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
-       start_lttng_tracing $SESSION_NAME
-
-       for i in `seq 1 5`; do
-               $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
-               ok $? "Start application $i for tracing"
-       done
-       wait_apps
-
-       stop_lttng_tracing $SESSION_NAME
-       destroy_lttng_session $SESSION_NAME
-
-       trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
-
-       return $?
-}
-
-test_before_multiple_apps() {
-       local out
-       local i
-
-       diag "Start multiple applications BEFORE tracing is started"
-
-       for i in `seq 1 5`; do
-               $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
-               ok $? "Start application $i for tracing"
-       done
-
-       # BEFORE application is spawned
-       create_lttng_session $SESSION_NAME $TRACE_PATH
-       enable_channel_per_uid $SESSION_NAME "channel0"
-       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
-       start_lttng_tracing $SESSION_NAME
-
-       # At least hit one event
-       sleep 2
-
-       stop_lttng_tracing $SESSION_NAME
-       destroy_lttng_session $SESSION_NAME
-
-       out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
-       if [ $out -eq 0 ]; then
-               fail "Trace validation"
-               diag "No event(s) found. We are supposed to have at least one."
-               out=1
-       else
-               pass "Trace validation"
-               diag "Found $out event(s). Coherent."
-               out=0
-       fi
-
-       wait_apps
-
-       return $out
-}
-
-test_after_app() {
-       local out
-
-       diag "Start application AFTER tracing is started"
-
-       # BEFORE application is spawned
-       create_lttng_session $SESSION_NAME $TRACE_PATH
-       enable_channel_per_uid $SESSION_NAME "channel0"
-       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
-       start_lttng_tracing $SESSION_NAME
-
-       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
-       ok $? "Start application to trace"
-
-       stop_lttng_tracing $SESSION_NAME
-       destroy_lttng_session $SESSION_NAME
-
-       trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
-
-       return $?
-}
-
-test_before_app() {
-       local out
-
-       diag "Start application BEFORE tracing is started"
-
-       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
-       ok $? "Start application to trace"
-
-       # BEFORE application is spawned
-       create_lttng_session $SESSION_NAME $TRACE_PATH
-       enable_channel_per_uid $SESSION_NAME "channel0"
-       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
-       start_lttng_tracing $SESSION_NAME
-
-       # At least hit one event
-       sleep 2
-
-       stop_lttng_tracing $SESSION_NAME
-       destroy_lttng_session $SESSION_NAME
-
-       out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
-       if [ $out -eq 0 ]; then
-               fail "Trace validation"
-               diag "No event(s) found. We are supposed to have at least one."
-               out=1
-       else
-               pass "Trace validation"
-               diag "Found $out event(s). Coherent."
-               out=0
-       fi
-
-       wait_apps
-
-       return $out
-}
-
-test_multiple_channels() {
-       local out
-
-       diag "Start with multiple channels"
-
-       # BEFORE application is spawned
-       create_lttng_session $SESSION_NAME $TRACE_PATH
-       enable_channel_per_uid $SESSION_NAME "channel0"
-       enable_channel_per_uid $SESSION_NAME "channel1"
-       enable_channel_per_uid $SESSION_NAME "channel2"
-       enable_channel_per_uid $SESSION_NAME "channel3"
-       enable_channel_per_uid $SESSION_NAME "channel4"
-       # Enable event in all channels.
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel0 -s $SESSION_NAME -u >/dev/null 2>&1
-       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel0"
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel1 -s $SESSION_NAME -u >/dev/null 2>&1
-       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel1"
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel2 -s $SESSION_NAME -u >/dev/null 2>&1
-       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel2"
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel3 -s $SESSION_NAME -u >/dev/null 2>&1
-       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel3"
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $EVENT_NAME -c channel4 -s $SESSION_NAME -u >/dev/null 2>&1
-       ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel4"
-       start_lttng_tracing $SESSION_NAME
-
-       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
-       ok $? "Start application to trace"
-
-       stop_lttng_tracing $SESSION_NAME
-       trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
-       out=$?
-
-       destroy_lttng_session $SESSION_NAME
-
-       return $out
-}
-
-# MUST set TESTDIR before calling those functions
-plan_tests $NUM_TESTS
-
-print_test_banner "$TEST_DESC"
-
-TESTS=(
-       "test_before_app"
-       "test_after_app"
-       "test_after_multiple_apps"
-       "test_before_multiple_apps"
-       "test_multiple_channels"
-)
-
-TEST_COUNT=${#TESTS[@]}
-i=0
-
-start_lttng_sessiond
-
-while [ $i -lt $TEST_COUNT ]; do
-       TRACE_PATH=$(mktemp -d)
-       ${TESTS[$i]}
-       rm -rf $TRACE_PATH
-       let "i++"
-done
-
-stop_lttng_sessiond
This page took 0.032671 seconds and 4 git commands to generate.