tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / regression / tools / snapshots / ust_test
index 54321817dc28fe575b5d62dedbb6278c52dd6f72..3f7ee2555d87a4ceb2640f7bc2ac5bab51a4bd45 100755 (executable)
@@ -1,19 +1,9 @@
 #!/bin/bash
 #
-# Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
+# Copyright (C) 2013 Julien Desfossez <jdesfossez@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
+# SPDX-License-Identifier: LGPL-2.1-only
+
 TEST_DESC="Snapshots - UST tracing"
 
 CURDIR=$(dirname $0)/
@@ -49,7 +39,7 @@ function start_test_app()
        local tmp_file=$(mktemp -u)
 
        # Start application with a temporary file.
-       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file &
+       $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file &
        ret=$?
        APPS_PID="${APPS_PID} ${!}"
        ok $ret "Start application to trace"
@@ -156,8 +146,6 @@ function enable_mmap_small_overwrite_ust_channel ()
 function test_ust_list_output ()
 {
        output_names=("randomname" "somesnapshot")
-       NR_ITER=2000000
-       NR_USEC_WAIT=100
 
        diag "Test UST snapshot output listing"
        create_lttng_session_no_output $SESSION_NAME
@@ -187,7 +175,7 @@ function test_ust_list_output ()
 
 function test_ust_local_snapshot ()
 {
-       NR_ITER=2000000
+       NR_ITER=-1
        NR_USEC_WAIT=100
 
        diag "Test local UST snapshots"
@@ -195,7 +183,7 @@ function test_ust_local_snapshot ()
        enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Returns once the application has at least fired ONE tracepoint.
        start_test_app
@@ -226,7 +214,7 @@ function test_ust_local_snapshot_small_discard_buffers ()
        enable_mmap_small_discard_ust_channel $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Run test apps, wait for them to complete.
        start_test_app
@@ -271,7 +259,7 @@ function test_ust_local_snapshot_small_overwrite_buffers ()
        enable_mmap_small_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Run test apps, wait for them to complete.
        start_test_app
@@ -306,7 +294,7 @@ function test_ust_local_snapshot_small_overwrite_buffers ()
 
 function test_ust_local_snapshot_max_size ()
 {
-       NR_ITER=2000000
+       NR_ITER=-1
        NR_USEC_WAIT=100
        page_size=`getconf PAGE_SIZE`
        num_cpus=$(conf_proc_count)
@@ -339,10 +327,10 @@ function test_ust_local_snapshot_max_size ()
        if [ "$sum_size_tracefiles" -gt "$max_size" ]; then
                fail "Tracefiles size sum validation"
                diag "Tracefiles size sum: $sum_size_tracefiles Expected max: $max_size"
+       else
+               pass "Tracefiles size sum validation"
        fi
 
-       pass "Tracefiles size sum validation"
-
        stop_lttng_tracing_ok $SESSION_NAME
        destroy_lttng_session_ok $SESSION_NAME
 
@@ -359,8 +347,6 @@ function test_ust_local_snapshot_max_size ()
 
 function test_ust_local_snapshot_large_metadata ()
 {
-       NR_ITER=2000000
-       NR_USEC_WAIT=100
        LM_EVENT="tp:tptest1,tp:tptest2,tp:tptest3,tp:tptest4,tp:tptest5"
        LM_PATH="$TESTDIR/utils/testapp"
        LM_NAME="gen-ust-nevents"
@@ -371,7 +357,7 @@ function test_ust_local_snapshot_large_metadata ()
        enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $LM_EVENT $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
        $LM_BIN 1 1
        ok $? "Start application to trace"
        lttng_snapshot_record $SESSION_NAME
@@ -388,8 +374,6 @@ function test_ust_local_snapshot_large_metadata ()
 
 function enable_channel_per_uid_mmap_overwrite()
 {
-       NR_ITER=2000000
-       NR_USEC_WAIT=100
        sess_name=$1
        channel_name=$2
 
@@ -399,12 +383,14 @@ function enable_channel_per_uid_mmap_overwrite()
 
 function test_ust_per_uid_local_snapshot ()
 {
+       NR_ITER=-1
+       NR_USEC_WAIT=100
        diag "Test per-uid local UST snapshots"
        create_lttng_session_no_output $SESSION_NAME
        enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Returns once the application has at least fired ONE tracepoint.
        start_test_app
@@ -425,7 +411,7 @@ function test_ust_per_uid_local_snapshot ()
 
 function test_ust_per_uid_local_snapshot_post_mortem ()
 {
-       NR_ITER=2000000
+       NR_ITER=-1
        NR_USEC_WAIT=100
 
        diag "Test local UST snapshots post-mortem"
@@ -433,7 +419,7 @@ function test_ust_per_uid_local_snapshot_post_mortem ()
        enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Returns once the application has at least fired ONE tracepoint.
        start_test_app
@@ -453,7 +439,7 @@ function test_ust_per_uid_local_snapshot_post_mortem ()
 
 function test_ust_local_snapshots ()
 {
-       NR_ITER=2000000
+       NR_ITER=-1
        NR_USEC_WAIT=100
 
        diag "Test $NR_SNAPSHOT local UST snapshots"
@@ -461,7 +447,7 @@ function test_ust_local_snapshots ()
        enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
        enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
        start_lttng_tracing_ok $SESSION_NAME
-       lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
+       lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH
 
        # Returns once the application has at least fired ONE tracepoint.
        start_test_app
This page took 0.025826 seconds and 4 git commands to generate.