- $session_name $channel_name $count_limit
-
- enable_ust_lttng_event_per_channel \
- $session_name $event_name $channel_name
-
- start_lttng_tracing_ok $session_name
-
- $TESTAPP_BIN $num_iter >/dev/null 2>&1
-
- stop_lttng_tracing_ok $session_name
+ "$session_name" "$channel_name" "$count_limit"
+
+ enable_ust_lttng_event_ok \
+ "$session_name" "$event_name" "$channel_name"
+
+ # Run the test app until the total stream size stops changing the
+ # expected size is exceeded (error).
+ #
+ # The `$stream_size` will not stabilize until the trace file count
+ # limit is reached. This is guaranteed by the use of start/produce/stop
+ # cycles forcing the consumption of buffers, preventing unwanted stall
+ # in stream size.
+ while [ "$stream_size" -ne "$previous_stream_size" ]; do
+ start_lttng_tracing_notap "$session_name"
+ taskset -c "$cpuno" "$TESTAPP_BIN" -i "$num_iter" >/dev/null 2>&1
+ stop_lttng_tracing_notap "$session_name"
+
+ previous_stream_size="$stream_size"
+ stream_size=$(get_total_stream_file_size "$trace_path" "$stream_pattern")
+ diag "Completed an iteration: previous size = $previous_stream_size bytes, new size = $stream_size bytes"
+
+ if [ "$stream_size" -gt "$expected_size" ]; then
+ diag "Total size for CPU $cpuno exceeds expected size: stream size = $stream_size bytes, expected size = $expected_size"
+ break
+ fi
+ done