Fix: test flaky sleep and wait patterns
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 19 Nov 2014 21:40:26 +0000 (22:40 +0100)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Jan 2015 03:28:43 +0000 (22:28 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
tests/regression/ust/python-logging/test_python_logging

Conflicts:
tests/regression/ust/java-jul/test_java_jul
tests/regression/ust/java-log4j/test_java_log4j
tests/utils/utils.sh

13 files changed:
tests/regression/tools/live/test_kernel
tests/regression/tools/live/test_ust
tests/regression/tools/live/test_ust_tracefile_count
tests/regression/tools/snapshots/test_ust_streaming
tests/regression/tools/snapshots/ust_test
tests/regression/tools/streaming/test_kernel
tests/regression/ust/java-jul/test_java_jul
tests/regression/ust/nprocesses/test_nprocesses
tests/stress/test_multi_sessions_per_uid_10app
tests/stress/test_multi_sessions_per_uid_5app_streaming
tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd
tests/utils/testapp/gen-ust-events/gen-ust-events.c
tests/utils/utils.sh

index ac4c19f56d8c7ff9b1a060363a801f7782cd0e01..bf5e79c574381dbd45f606d943dfdbc6a5775429 100755 (executable)
@@ -63,18 +63,16 @@ else
 fi
 
 if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
-       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
+       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-sessiond"
                exit 1
        fi
-       # Wait for sessiond to bootstrap
-       sleep 2
 fi
 
-opt="-o $TRACE_PATH"
+opt="--background -o $TRACE_PATH"
 if [ -z $(pidof lt-$RELAYD_BIN) ]; then
-       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1 &
+       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-relayd (opt: $opt)"
                return 1
index d4110ceafdc86db147b4819ea1cd2e6621764939..e20150965c180e5d18b9c8aeeba9d93118201032 100755 (executable)
@@ -60,18 +60,16 @@ function clean_live_tracing()
 }
 
 if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
-       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
+       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-sessiond"
                exit 1
        fi
-       # Wait for sessiond to bootstrap
-       sleep 2
 fi
 
-opt="-o $TRACE_PATH"
+opt="-o $TRACE_PATH --background"
 if [ -z $(pidof lt-$RELAYD_BIN) ]; then
-       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1 &
+       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-relayd (opt: $opt)"
                return 1
index 464f4aacb69b60fe1879e88c520863c994d7802d..63d7854763236f45cc0c87d7ac6546494da4f15d 100755 (executable)
@@ -61,18 +61,16 @@ function clean_live_tracing()
 }
 
 if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
-       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
+       $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-sessiond"
                exit 1
        fi
-       # Wait for sessiond to bootstrap
-       sleep 2
 fi
 
-opt="-o $TRACE_PATH"
+opt="-o $TRACE_PATH --background"
 if [ -z $(pidof lt-$RELAYD_BIN) ]; then
-       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1 &
+       $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt >/dev/null 2>&1
        if [ $? -eq 1 ]; then
                echo "Fail to start lttng-relayd (opt: $opt)"
                return 1
index c0d98c2df1ff0dfb686b7ac7c23eb06ea8d9443c..52330a5c9f8362b1625cbe05f17b71a257c5edbf 100755 (executable)
@@ -28,6 +28,7 @@ TESTAPP_NAME="gen-ust-events"
 TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
 NR_ITER=2000000
 NR_USEC_WAIT=100
+APPS_PID=
 
 TRACE_PATH=$(mktemp -d)
 
@@ -55,13 +56,15 @@ function snapshot_add_output ()
 }
 
 # Start trace application and return once one event has been hit.
-function start_trace_app()
+function start_test_app()
 {
        local tmp_file="/tmp/lttng_test_ust.42.file"
 
        # Start application with a temporary file.
        $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file &
-       ok $? "Start application to trace"
+       ret=$?
+       APPS_PID="${APPS_PID} ${!}"
+       ok $ret "Start application to trace"
 
        # Wait for the application file to appear indicating that at least one
        # tracepoint has been fired.
@@ -72,13 +75,13 @@ function start_trace_app()
        rm -f $tmp_file
 }
 
-function stop_trace_app()
+function stop_test_apps()
 {
-       diag "Killing $TESTAPP_NAME"
-       PID_APP=`pidof $TESTAPP_NAME`
-       kill $PID_APP >/dev/null 2>&1
-       diag "Waiting on $TESTAPP_NAME"
-       wait
+       diag "Stopping $TESTAPP_NAME"
+       for p in ${APPS_PID}; do
+               kill ${p}
+               wait ${p} 2>&1
+       done
 }
 
 # Test a snapshot using a default name for the output destination.
@@ -90,7 +93,7 @@ function test_ust_default_name_with_del()
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing $SESSION_NAME
 
-       start_trace_app
+       start_test_app
 
        snapshot_add_output $SESSION_NAME "net://localhost"
        lttng_snapshot_record $SESSION_NAME
@@ -99,7 +102,7 @@ function test_ust_default_name_with_del()
        echo $TRACE_PATH/$HOSTNAME/snapshot-1
        validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
        if [ $? -ne 0 ]; then
-               stop_trace_app
+               stop_test_apps
                return $?
        fi
 
@@ -110,14 +113,14 @@ function test_ust_default_name_with_del()
        # Validate test with the next ID since a del output was done prior.
        validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-2*
        if [ $? -ne 0 ]; then
-               stop_trace_app
+               stop_test_apps
                return $?
        fi
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 
-       stop_trace_app
+       stop_test_apps
 
        return 0
 }
@@ -131,7 +134,7 @@ function test_ust_default_name()
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing $SESSION_NAME
 
-       start_trace_app
+       start_test_app
 
        snapshot_add_output $SESSION_NAME "net://localhost"
        lttng_snapshot_record $SESSION_NAME
@@ -141,7 +144,7 @@ function test_ust_default_name()
        validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
        out=$?
 
-       stop_trace_app
+       stop_test_apps
 
        return $out
 }
@@ -154,7 +157,7 @@ function test_ust_default_name_custom_uri()
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing $SESSION_NAME
 
-       start_trace_app
+       start_test_app
 
        snapshot_add_output $SESSION_NAME "-C tcp://localhost:5342 -D tcp://localhost:5343"
        lttng_snapshot_record $SESSION_NAME
@@ -164,7 +167,7 @@ function test_ust_default_name_custom_uri()
        validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
        out=$?
 
-       stop_trace_app
+       stop_test_apps
 
        return $out
 }
@@ -181,7 +184,7 @@ function test_ust_custom_name()
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing $SESSION_NAME
 
-       start_trace_app
+       start_test_app
 
        snapshot_add_output $SESSION_NAME "net://localhost" $name
        lttng_snapshot_record $SESSION_NAME
@@ -198,7 +201,7 @@ function test_ust_custom_name()
                out=1
        fi
 
-       stop_trace_app
+       stop_test_apps
 
        return $out
 }
index 0a9e244d814b45c2130bbd2e81172d88269290dd..9dd95bf2bb257569e95da06d084bbeabc736ac56 100755 (executable)
@@ -27,6 +27,7 @@ TESTAPP_NAME="gen-ust-events"
 TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
 NR_ITER=2000000
 NR_USEC_WAIT=100
+APPS_PID=
 
 NUM_TESTS=76
 
@@ -52,7 +53,9 @@ function start_test_app()
 
        # Start application with a temporary file.
        $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file &
-       ok $? "Start application to trace"
+       ret=$?
+       APPS_PID="${APPS_PID} ${!}"
+       ok $ret "Start application to trace"
 
        # Wait for the application file to appear indicating that at least one
        # tracepoint has been fired.
@@ -63,13 +66,13 @@ function start_test_app()
        rm -f $tmp_file
 }
 
-function stop_test_app()
+function stop_test_apps()
 {
-       diag "Killing $TESTAPP_NAME"
-       PID_APP=`pidof $TESTAPP_NAME`
-       kill $PID_APP >/dev/null 2>&1
-       diag "Waiting on $TESTAPP_NAME"
-       wait
+       diag "Stopping $TESTAPP_NAME"
+       for p in ${APPS_PID}; do
+               kill ${p}
+               wait ${p} 2>&1
+       done
 }
 
 function snapshot_add_output ()
@@ -172,7 +175,7 @@ function test_ust_local_snapshot ()
                rm -rf $TRACE_PATH
        fi
 
-       stop_test_app
+       stop_test_apps
 }
 
 function test_ust_local_snapshot_max_size ()
@@ -220,7 +223,7 @@ function test_ust_local_snapshot_max_size ()
                rm -rf $TRACE_PATH
        fi
 
-       stop_test_app
+       stop_test_apps
 }
 
 function test_ust_local_snapshot_large_metadata ()
@@ -282,7 +285,7 @@ function test_ust_per_uid_local_snapshot ()
                rm -rf $TRACE_PATH
        fi
 
-       stop_test_app
+       stop_test_apps
 }
 
 function test_ust_per_uid_local_snapshot_post_mortem ()
@@ -296,7 +299,7 @@ function test_ust_per_uid_local_snapshot_post_mortem ()
 
        # Returns once the application has at least fired ONE tracepoint.
        start_test_app
-       stop_test_app
+       stop_test_apps
 
        lttng_snapshot_record $SESSION_NAME
        stop_lttng_tracing $SESSION_NAME
@@ -336,7 +339,7 @@ function test_ust_local_snapshots ()
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 
-       stop_test_app
+       stop_test_apps
 }
 
 plan_tests $NUM_TESTS
index 9877bb8d949f455c3e9ef071169c26f787eb7965..1e272c39aa92f0f48cd074b7b7637736e90c549a 100755 (executable)
@@ -52,13 +52,6 @@ function test_kernel_before_start ()
        sleep 1
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
-
-       # We can not predict _yet_ when the trace is available so we have to do a
-       # arbitratry sleep to validate the trace.
-       diag "Wait 3 seconds for the trace to be written on disk"
-       for i in `seq 1 3`; do
-               sleep 1
-       done
 }
 
 # Deactivated since this feature is not yet available where we can enable
index 0859e963fe4aee7f544ea37941ea306fb348282b..08214c0ebb8ad25e0521ff350cf7754a335ef79f 100755 (executable)
@@ -80,7 +80,8 @@ function test_jul_before_start ()
 
        start_lttng_tracing $SESSION_NAME
 
-       wait_apps
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
@@ -296,7 +297,8 @@ function test_jul_destroy_session()
        # Run 5 times with a 1 second delay
        run_app 0 1
 
-       sleep 1
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
@@ -311,7 +313,11 @@ function test_jul_destroy_session()
        enable_jul_lttng_event $SESSION_NAME $EVENT_NAME2
        start_lttng_tracing $SESSION_NAME
 
-       wait_apps
+       # Run 5 times with a 1 second delay
+       run_app_background 0 1
+
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
index 84d0ff7a03a8d92eaaacd474975ede1d16086370..396dab0d8a026fbdb3a38f1846918c077dc9bbfc 100755 (executable)
@@ -19,7 +19,7 @@ TEST_DESC="UST tracer - Generate $NUM_PROCESS process"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../../..
-NR_ITER=1000
+NR_ITER=-1     # infinite loop
 NR_USEC_WAIT=1000000
 TESTAPP_PATH="$TESTDIR/utils/testapp"
 TESTAPP_NAME="gen-ust-events"
@@ -28,6 +28,7 @@ SESSION_NAME="ust-nprocesses"
 EVENT_NAME="tp:tptest"
 TEST_WAIT_SEC=5
 NUM_TESTS=9
+APPS_PID=
 
 source $TESTDIR/utils/utils.sh
 
@@ -43,20 +44,24 @@ print_test_banner "$TEST_DESC"
 
 start_lttng_sessiond
 
-# Start test for 1000 seconds
+# Start tests. Each is an infinite tracing loop.
 
+diag "Starting $NUM_PROCESS test applications"
 for i in `seq 1 $NUM_PROCESS`
 do
        $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
+       APPS_PID="${APPS_PID} ${!}"
 done
 
+diag "Waiting for applications to be registered to sessiond"
+
 reg_app_count=0
 while [ $reg_app_count -ne $NUM_PROCESS ]; do
        listing=$($TESTDIR/../src/bin/lttng/$LTTNG_BIN list -u)
        reg_app_count=$(echo -n $listing | sed "s#$TESTAPP_BIN#$TESTAPP_BIN\n#g" | grep "$TESTAPP_BIN" | wc -l)
 done
 
-pass "Trace validation"
+pass "All applications are registered to sessiond"
 
 TRACE_PATH=$(mktemp -d)
 
@@ -65,10 +70,8 @@ create_lttng_session $SESSION_NAME $TRACE_PATH
 enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
 start_lttng_tracing $SESSION_NAME
 
-diag "Sleeping $TEST_WAIT_SEC seconds for tracing to start everywhere"
-diag "Warning: this arbitrary time can make the test fail on slower system"
-
-sleep $TEST_WAIT_SEC
+# We don't validate whether the applications have traced here, rather
+# just that they registered to sessiond (above).
 
 stop_lttng_tracing $SESSION_NAME
 destroy_lttng_session $SESSION_NAME
@@ -76,8 +79,10 @@ destroy_lttng_session $SESSION_NAME
 rm -rf $TRACE_PATH
 
 diag "Stopping all spawned applications"
-killall -q $TESTAPP_NAME >/dev/null 2>&1
-wait
+for p in ${APPS_PID}; do
+       kill ${p}
+       wait ${p} 2>/dev/null
+done
 pass "Stopped all spawned applications"
 
 stop_lttng_sessiond
index c960957f216a217c1a5326911a88df0780455d06..365519dc661b2fe890ca35e63a787287c3360d3a 100755 (executable)
@@ -67,10 +67,8 @@ function start_sessiond()
        if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
                # We have to start it like this so the ulimit -c is used by this
                # process. Also, we collect any error message printed out.
-               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE 2>&1 &
+               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --background --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE 2>&1
                status=$?
-               # Wait for sessiond to bootstrap
-               sleep 2
                ok $status "Start session daemon"
        fi
 }
index eb68107d5d08b55e7f77516cdb7ac8bc99db1e0f..40c0a4d960732facd36cb6fb8ce651e936ef786d 100755 (executable)
@@ -89,10 +89,8 @@ function start_sessiond()
        if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
                # We have to start it like this so the ulimit -c is used by this
                # process. Also, we collect any error message printed out.
-               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1 &
+               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --background --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1
                status=$?
-               # Wait for sessiond to bootstrap
-               sleep 2
                ok $status "Start session daemon"
        fi
 }
index 4ff927646b97e6f347d6508bd836e40128295f1a..fa41b4cbb39e7269b1c18b53f5ecfcac3f1e0a96 100755 (executable)
@@ -76,12 +76,10 @@ function start_sessiond()
        if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
                # We have to start it like this so the ulimit -c is used by this
                # process. Also, we collect any error message printed out.
-               #$TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1 &
-               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --verbose-consumer -vvv --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1 &
-               #$TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1 &
+               #$TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --quiet --background --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1
+               $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --verbose-consumer -vvv --background --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1
+               #$TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --consumerd32-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$TESTDIR/../src/bin/lttng-consumerd/lttng-consumerd" >$LOG_FILE_SESSIOND 2>&1
                status=$?
-               # Wait for sessiond to bootstrap
-               sleep 2
                ok $status "Start session daemon"
        fi
 }
index 77d88db2d184c7506f522a06974e975c644b4c4a..42fa082a9faf30227cfb1f2610ce148eae776729 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <stdbool.h>
 
 #define TRACEPOINT_DEFINE
 #include "tp.h"
@@ -47,16 +48,20 @@ void create_file(const char *path)
 
 int main(int argc, char **argv)
 {
-       int i, netint;
+       unsigned int i, netint;
        long values[] = { 1, 2, 3 };
        char text[10] = "test";
        double dbl = 2.0;
        float flt = 2222.0;
-       unsigned int nr_iter = 100;
+       int nr_iter = 100;
        useconds_t nr_usec = 0;
        char *tmp_file_path = NULL;
+       bool file_created = false;
 
        if (argc >= 2) {
+               /*
+                * If nr_iter is negative, do an infinite tracing loop.
+                */
                nr_iter = atoi(argv[1]);
        }
 
@@ -69,7 +74,7 @@ int main(int argc, char **argv)
                tmp_file_path = argv[3];
        }
 
-       for (i = 0; i < nr_iter; i++) {
+       for (i = 0; nr_iter < 0 || i < nr_iter; i++) {
                netint = htonl(i);
                tracepoint(tp, tptest, i, netint, values, text, strlen(text), dbl,
                                flt);
@@ -78,8 +83,9 @@ int main(int argc, char **argv)
                 * First loop we create the file if asked to indicate that at least one
                 * tracepoint has been hit.
                 */
-               if (i == 0 && tmp_file_path) {
+               if (!file_created && tmp_file_path) {
                        create_file(tmp_file_path);
+                       file_created = true;
                }
                usleep(nr_usec);
        }
index c2bebf4a267e856dde080643608322c39c8923d5..d5624990d87446c85dd4dcc0302be987e0ae87ed 100644 (file)
@@ -169,7 +169,7 @@ function start_lttng_sessiond()
 
        if [ -z $(pidof lt-$SESSIOND_BIN) ]; then
                $DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
-               #$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --verbose-consumer >>/tmp/sessiond.log 2>&1 &
+               #$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --verbose-consumer >>/tmp/sessiond.log 2>&1
                status=$?
                ok $status "Start session daemon"
        fi
This page took 0.036003 seconds and 4 git commands to generate.