3 # Copyright (C) 2019 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # SPDX-License-Identifier: LGPL-2.1-only
7 TEST_DESC
="Clear - UST tracing"
10 TESTDIR
=$CURDIR/..
/..
/..
11 EVENT_NAME
="tp:tptest"
13 TESTAPP_PATH
="$TESTDIR/utils/testapp"
14 TESTAPP_NAME
="gen-ust-events"
15 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
19 PAGE_SIZE
=$
(getconf PAGE_SIZE
)
20 TRACE_PATH
=$
(mktemp
-d)
22 source $TESTDIR/utils
/utils.sh
24 if [ ! -x "$TESTAPP_BIN" ]; then
25 BAIL_OUT
"No UST events binary detected."
28 function clean_path
()
36 function cond_start_tracing
()
39 local tracing_active
=$2
41 if [[ $tracing_active -ne 1 ]]; then
42 start_lttng_tracing_ok
$session_name
46 function cond_stop_tracing
()
49 local tracing_active
=$2
51 if [[ $tracing_active -ne 1 ]]; then
52 stop_lttng_tracing_ok
$session_name
56 function do_clear_session
()
59 local tracing_active
=$2
61 local rotate_before
=$4
64 cond_stop_tracing
$session_name $tracing_active
65 if [[ $rotate_before -eq 1 ]]; then
66 rotate_session_ok
$SESSION_NAME
68 lttng_clear_session_ok
$SESSION_NAME
69 if [[ $clear_twice -eq 1 ]]; then
70 lttng_clear_session_ok
$SESSION_NAME
72 if [[ $rotate_after -eq 1 ]]; then
73 if [[ $tracing_active -eq 1 ]]; then
74 rotate_session_ok
$SESSION_NAME
77 rotate_session_fail
$SESSION_NAME
80 cond_start_tracing
$session_name $tracing_active
83 function test_ust_streaming
()
85 local tracing_active
=$1
87 local rotate_before
=$3
90 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
91 local channel_name
="chan"
93 diag
"Test ust streaming clear"
94 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
95 create_lttng_session_uri
$SESSION_NAME net
://localhost
96 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
97 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
98 start_lttng_tracing_ok
$SESSION_NAME
100 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
101 stop_lttng_tracing_ok
$SESSION_NAME
103 if [[ $rotate_before -eq 1 ]]; then
104 validate_trace_count
$EVENT_NAME $local_path 10
106 if [[ "$buffer_type" == "uid" ]]; then
107 validate_trace_empty
$local_path
109 validate_directory_empty
$local_path
113 destroy_lttng_session_ok
$SESSION_NAME
116 function test_ust_streaming_no_event
()
118 local tracing_active
=$1
120 #local rotate_before=$3 ignored
121 #local rotate_after=$4
122 local buffer_type
=uid
123 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
124 local channel_name
="chan"
126 diag
"Test ust streaming clear no event"
127 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
128 create_lttng_session_uri
$SESSION_NAME net
://localhost
129 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
130 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
131 start_lttng_tracing_ok
$SESSION_NAME
133 do_clear_session
$SESSION_NAME "$tracing_active" "$clear_twice" "$rotate_before" "$rotate_after"
134 stop_lttng_tracing_ok
$SESSION_NAME
136 validate_directory_empty
"$local_path"
138 destroy_lttng_session_ok
$SESSION_NAME
141 function test_ust_streaming_rotate_clear
()
143 local tracing_active
=$1
145 local rotate_before
=$3
146 local rotate_after
=$4
148 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
149 local channel_name
="chan"
151 diag
"Test ust streaming rotate-clear"
152 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
153 create_lttng_session_uri
$SESSION_NAME net
://localhost
154 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
155 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
156 start_lttng_tracing_ok
$SESSION_NAME
158 rotate_session_ok
$SESSION_NAME
160 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
162 stop_lttng_tracing_ok
$SESSION_NAME
164 if [[ $rotate_before -eq 1 ]]; then
169 validate_trace_count
$EVENT_NAME $local_path $expect_count
171 destroy_lttng_session_ok
$SESSION_NAME
174 function test_ust_streaming_clear_rotate
()
176 local tracing_active
=$1
178 local rotate_before
=$3
179 local rotate_after
=$4
181 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
182 local channel_name
="chan"
184 diag
"Test ust streaming clear-rotate"
185 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
186 create_lttng_session_uri
$SESSION_NAME net
://localhost
187 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
188 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
189 start_lttng_tracing_ok
$SESSION_NAME
191 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
193 rotate_session_ok
$SESSION_NAME
195 stop_lttng_tracing_ok
$SESSION_NAME
197 if [[ $rotate_before -eq 1 ]]; then
202 validate_trace_count
$EVENT_NAME $local_path $expect_count
204 destroy_lttng_session_ok
$SESSION_NAME
207 function test_ust_streaming_live
()
209 local tracing_active
=$1
213 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
214 local channel_name
="chan"
216 diag
"Test ust streaming live clear"
217 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
218 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
219 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
220 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
221 start_lttng_tracing_ok
$SESSION_NAME
223 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
224 stop_lttng_tracing_ok
$SESSION_NAME
226 validate_directory_empty
$local_path
228 destroy_lttng_session_ok
$SESSION_NAME
232 function test_ust_basic_streaming_live_viewer
()
234 local tracing_active
=$1
238 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
239 local remote_trace_path
="${HOSTNAME}/${SESSION_NAME}"
240 local channel_name
="chan"
241 local bt_output_path
=$
(mktemp
-u)
242 local file_sync_before_exit
=$
(mktemp
-u)
244 diag
"Test ust basic streaming live with viewer"
245 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
246 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
247 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
248 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
249 start_lttng_tracing_ok
$SESSION_NAME
251 wait_live_trace_ready net
://localhost
253 # Connect a live viewer
254 $BABELTRACE_BIN -i lttng-live net
://localhost
/host
/$remote_trace_path > $bt_output_path &
257 wait_live_viewer_connect net
://localhost
259 $TESTAPP_BIN -i 10 --sync-before-exit $file_sync_before_exit &
262 diag
"Wait until viewer sees all 10 expected events"
264 while [ $evcount -ne 10 ]; do
265 evcount
=$
(cat $bt_output_path |
wc -l)
268 pass
"Live viewer read $evcount events, expect 10"
270 destroy_lttng_session_ok
$SESSION_NAME
271 touch $file_sync_before_exit
272 diag
"Wait for application to exit"
274 pass
"Wait for application to exit"
275 diag
"Wait for viewer to exit"
277 ok $?
"Babeltrace succeeds"
278 pass
"Wait for viewer to exit"
280 rm -f $bt_output_path
281 rm -f $file_sync_before_exit
284 function test_ust_streaming_live_viewer
()
286 local tracing_active
=$1
290 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
291 local remote_trace_path
="${HOSTNAME}/${SESSION_NAME}"
292 local channel_name
="chan"
293 local bt_output_path
=$
(mktemp
-d)/bt-output.txt
295 diag
"Test ust streaming live clear with viewer"
296 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
297 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
298 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
299 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
300 start_lttng_tracing_ok
$SESSION_NAME
302 wait_live_trace_ready net
://localhost
304 # Connect a live viewer
305 $BABELTRACE_BIN -i lttng-live net
://localhost
/host
/$remote_trace_path > $bt_output_path &
308 wait_live_viewer_connect net
://localhost
311 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
312 stop_lttng_tracing_ok
$SESSION_NAME
314 destroy_lttng_session_ok
$SESSION_NAME
315 diag
"Wait for viewer to exit"
317 ok $?
"Babeltrace succeeds"
318 pass
"Wait for viewer to exit"
320 clean_path
$bt_output_path
323 function test_ust_local
()
325 local tracing_active
=$1
327 local rotate_before
=$3
328 local rotate_after
=$4
330 local channel_name
="chan"
332 diag
"Test ust local"
333 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
334 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
335 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
336 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
337 start_lttng_tracing_ok
$SESSION_NAME
339 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
340 stop_lttng_tracing_ok
$SESSION_NAME
342 if [[ $rotate_before -eq 1 ]]; then
343 validate_trace_count
$EVENT_NAME $TRACE_PATH 10
345 if [[ "$buffer_type" == "uid" ]]; then
346 validate_trace_empty
$TRACE_PATH
348 validate_directory_empty
$TRACE_PATH
352 destroy_lttng_session_ok
$SESSION_NAME
355 function test_ust_local_no_event
()
357 local tracing_active
=$1
359 #local rotate_before=$3 ignored
360 #local rotate_after=$4 ignored
362 local channel_name
="chan"
364 diag
"Test ust local no event"
365 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
366 create_lttng_session_ok
$SESSION_NAME "$TRACE_PATH"
367 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name "--buffers-$buffer_type"
368 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
369 start_lttng_tracing_ok
$SESSION_NAME
371 do_clear_session
$SESSION_NAME "$tracing_active" "$clear_twice" "$rotate_before" "$rotate_after"
372 stop_lttng_tracing_ok
$SESSION_NAME
374 validate_directory_empty
"$TRACE_PATH"
376 destroy_lttng_session_ok
$SESSION_NAME
379 function test_ust_local_rotate_clear
()
381 local tracing_active
=$1
383 local rotate_before
=$3
384 local rotate_after
=$4
386 local channel_name
="chan"
388 diag
"Test ust local rotate-clear"
389 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
390 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
391 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
392 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
393 start_lttng_tracing_ok
$SESSION_NAME
395 rotate_session_ok
$SESSION_NAME
397 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
399 stop_lttng_tracing_ok
$SESSION_NAME
401 if [[ $rotate_before -eq 1 ]]; then
406 validate_trace_count
$EVENT_NAME $TRACE_PATH $expect_count
408 destroy_lttng_session_ok
$SESSION_NAME
411 function test_ust_local_clear_rotate
()
413 local tracing_active
=$1
415 local rotate_before
=$3
416 local rotate_after
=$4
418 local channel_name
="chan"
420 diag
"Test ust local clear-rotate"
421 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
422 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
423 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
424 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
425 start_lttng_tracing_ok
$SESSION_NAME
427 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
429 rotate_session_ok
$SESSION_NAME
431 stop_lttng_tracing_ok
$SESSION_NAME
433 if [[ $rotate_before -eq 1 ]]; then
438 validate_trace_count
$EVENT_NAME $TRACE_PATH $expect_count
440 destroy_lttng_session_ok
$SESSION_NAME
443 function do_ust_snapshot
()
445 local session_name
=$1
447 local tracing_active
=$3
450 local channel_name
="snapshot"
452 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
453 enable_ust_lttng_event_ok
$session_name $EVENT_NAME $channel_name
454 start_lttng_tracing_ok
$session_name
456 # Generate 10 events that will sit in the buffers.
459 # Take a first snapshot and validate that the events are present.
460 lttng_snapshot_record
$session_name
461 stop_lttng_tracing_ok
$session_name
462 validate_trace_count
$EVENT_NAME $trace_path 10
464 # Clean the output path
465 clean_path
$trace_path
466 start_lttng_tracing_ok
$session_name
468 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
470 # Make sure the subsequent snapshot is empty and valid.
471 lttng_snapshot_record
$session_name
472 stop_lttng_tracing_ok
$session_name
473 validate_trace_empty
$trace_path
475 # Clean the output path
476 clean_path
$trace_path
477 start_lttng_tracing_ok
$session_name
479 # Make sure that everything still works, generate events and take a
482 lttng_snapshot_record
$session_name
483 stop_lttng_tracing_ok
$session_name
484 validate_trace_count
$EVENT_NAME $trace_path 10
487 function test_ust_streaming_snapshot
()
489 local tracing_active
=$1
494 diag
"Test ust streaming snapshot clear"
495 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
497 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--snapshot"
498 do_ust_snapshot
$SESSION_NAME $TRACE_PATH $tracing_active $clear_twice $buffer_type
499 destroy_lttng_session_ok
$SESSION_NAME
502 function test_ust_local_snapshot
()
504 local tracing_active
=$1
509 diag
"Test ust local snapshot clear"
510 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
512 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH "--snapshot"
513 do_ust_snapshot
$SESSION_NAME $TRACE_PATH $tracing_active $clear_twice $buffer_type
514 destroy_lttng_session_ok
$SESSION_NAME
517 # snapshot for per-pid is tested independently of the "buffer type" parameter
518 # because an application needs to be live to appear in a snapshot.
519 function test_ust_local_snapshot_per_pid
()
521 local tracing_active
=$1
525 local channel_name
="channel0"
526 local file_sync_before_last
=$
(mktemp
-u)
527 local file_sync_before_last_touch
=$
(mktemp
-u)
528 local file_sync_before_exit
=$
(mktemp
-u)
529 local file_sync_before_exit_touch
=$
(mktemp
-u)
531 diag
"Test ust local snapshot clear per pid"
532 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
534 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH "--snapshot"
535 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
536 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
537 start_lttng_tracing_ok
$SESSION_NAME
539 # Generate 10 events that will sit in the buffers.
540 $TESTAPP_BIN -i 10 -w 0 \
541 --sync-before-last-event ${file_sync_before_last} \
542 --sync-before-last-event-touch ${file_sync_before_last_touch} \
543 --sync-before-exit ${file_sync_before_exit} \
544 --sync-before-exit-touch ${file_sync_before_exit_touch} >/dev
/null
2>&1 &
546 # Continue only when there is only the last event remaining.
547 while [ ! -f "${file_sync_before_last_touch}" ]; do
551 # Take a first snapshot and validate that the events are present.
552 lttng_snapshot_record
$SESSION_NAME
553 stop_lttng_tracing_ok
$SESSION_NAME
554 validate_trace_count
$EVENT_NAME $TRACE_PATH 9
556 # Clean the output path
557 clean_path
$TRACE_PATH
558 start_lttng_tracing_ok
$SESSION_NAME
560 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
562 # Make sure the subsequent snapshot is empty and valid.
563 lttng_snapshot_record
$SESSION_NAME
564 stop_lttng_tracing_ok
$SESSION_NAME
565 validate_trace_empty
$TRACE_PATH
567 # Validate that tracing still works and subsequent snapshots are valid.
568 # Clean the output path.
569 clean_path
$TRACE_PATH
570 start_lttng_tracing_ok
$SESSION_NAME
572 # Continue over the last event.
573 touch ${file_sync_before_last}
575 # Wait for the before exit sync point. This ensure that we went over the
577 while [ ! -f "${file_sync_before_exit_touch}" ]; do
581 # Make sure the snapshot contains the last event.
582 lttng_snapshot_record
$SESSION_NAME
583 stop_lttng_tracing_ok
$SESSION_NAME
584 validate_trace_count
$EVENT_NAME $TRACE_PATH 1
586 # Release the application.
587 touch ${file_sync_before_exit}
589 destroy_lttng_session_ok
$SESSION_NAME
591 rm -f ${file_sync_before_last}
592 rm -f ${file_sync_before_last_touch}
593 rm -f ${file_sync_before_exit}
594 rm -f ${file_sync_before_exit_touch}
597 function test_ust_streaming_tracefile_rotation
()
599 local tracing_active
=$1
601 local rotate_before
=$3
602 local rotate_after
=$4
604 local channel_name
="rotchan"
605 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
607 diag
"Test ust streaming clear with tracefile rotation"
608 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
609 create_lttng_session_uri
$SESSION_NAME net
://localhost
610 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --subbuf-size=$PAGE_SIZE \
611 --tracefile-size=$PAGE_SIZE --tracefile-count=2 --buffers-$buffer_type
612 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
613 start_lttng_tracing_ok
$SESSION_NAME
615 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
616 stop_lttng_tracing_ok
$SESSION_NAME
618 if [[ $rotate_before -eq 1 ]]; then
619 validate_trace_count
$EVENT_NAME $local_path 10
621 if [[ "$buffer_type" == "uid" ]]; then
622 validate_trace_empty
$local_path
624 validate_directory_empty
$local_path
628 start_lttng_tracing_ok
$SESSION_NAME
630 stop_lttng_tracing_ok
632 if [[ $rotate_before -eq 1 ]]; then
633 validate_trace_count
$EVENT_NAME $local_path 30
635 validate_trace_count
$EVENT_NAME $local_path 20
638 destroy_lttng_session_ok
$SESSION_NAME
641 # With 1 byte per event (as strict minimum), generating 200000 events
642 # guarantees filling up 2 files of 64k in size, which is the maximum
643 # page size known on Linux
644 function test_ust_streaming_tracefile_rotation_overwrite_files
()
646 local tracing_active
=$1
648 local rotate_before
=$3
649 local rotate_after
=$4
651 local channel_name
="rotchan"
652 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
654 diag
"Test ust streaming clear with tracefile rotation, overwrite files"
655 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
656 create_lttng_session_uri
$SESSION_NAME net
://localhost
657 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --subbuf-size=$PAGE_SIZE \
658 --tracefile-size=$PAGE_SIZE --tracefile-count=2 --buffers-$buffer_type
659 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
660 start_lttng_tracing_ok
$SESSION_NAME
661 taskset
-c 0 $TESTAPP_BIN -i 200000
662 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
663 stop_lttng_tracing_ok
$SESSION_NAME
665 if [[ $rotate_before -eq 1 ]]; then
666 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 200000
668 if [[ "$buffer_type" == "uid" ]]; then
669 validate_trace_empty
$local_path
671 validate_directory_empty
$local_path
675 start_lttng_tracing_ok
$SESSION_NAME
676 taskset
-c 0 $TESTAPP_BIN -i 400000
677 stop_lttng_tracing_ok
679 if [[ $rotate_before -eq 1 ]]; then
680 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 600000
682 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 200000
685 destroy_lttng_session_ok
$SESSION_NAME
688 function test_ust_disallow_clear
()
690 diag
"Test ust disallow clear on relay daemon"
691 SESSION_NAME
=$
(randstring
16 0)
693 LTTNG_RELAYD_DISALLOW_CLEAR
=1 start_lttng_relayd
"-o $TRACE_PATH"
697 create_lttng_session_uri
$SESSION_NAME net
://localhost
698 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME
699 start_lttng_tracing_ok
$SESSION_NAME
700 lttng_clear_session_fail
$SESSION_NAME
701 destroy_lttng_session_ok
$SESSION_NAME
705 clean_path
$TRACE_PATH
708 plan_tests
$NUM_TESTS
710 print_test_banner
"$TEST_DESC"
712 streaming_tests
=(test_ust_streaming
713 test_ust_streaming_rotate_clear
714 test_ust_streaming_clear_rotate
715 test_ust_streaming_tracefile_rotation
716 test_ust_streaming_tracefile_rotation_overwrite_files
717 test_ust_streaming_no_event
720 live_tests
=(test_ust_streaming_live
721 test_ust_basic_streaming_live_viewer
722 test_ust_streaming_live_viewer
725 local_tests
=(test_ust_local
726 test_ust_local_rotate_clear
727 test_ust_local_clear_rotate
728 test_ust_local_no_event
731 snapshot_uid_tests
=(test_ust_streaming_snapshot
732 test_ust_local_snapshot
735 snapshot_pid_tests
=(test_ust_local_snapshot_per_pid
)
737 start_lttng_relayd
"-o $TRACE_PATH"
742 # Clear with tracing active, clear once
743 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
745 SESSION_NAME
=$
(randstring
16 0)
746 ${fct_test} 1 0 0 0 uid
747 clean_path
$TRACE_PATH
750 # Clear with tracing active, clear twice
751 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
753 SESSION_NAME
=$
(randstring
16 0)
754 ${fct_test} 1 1 0 0 uid
755 clean_path
$TRACE_PATH
758 # Clear with tracing inactive, clear once
759 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
761 SESSION_NAME
=$
(randstring
16 0)
762 ${fct_test} 0 0 0 0 uid
763 clean_path
$TRACE_PATH
766 # Clear with tracing inactive, clear twice
767 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
769 SESSION_NAME
=$
(randstring
16 0)
770 ${fct_test} 0 1 0 0 uid
771 clean_path
$TRACE_PATH
774 # Clear with tracing inactive, rotate-clear once
775 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
777 SESSION_NAME
=$
(randstring
16 0)
778 ${fct_test} 0 0 1 0 uid
779 clean_path
$TRACE_PATH
782 # Clear with tracing inactive, clear once-rotate(fail)
783 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
785 SESSION_NAME
=$
(randstring
16 0)
786 ${fct_test} 0 0 0 1 uid
787 clean_path
$TRACE_PATH
793 # Clear with tracing active, clear once
794 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
796 SESSION_NAME
=$
(randstring
16 0)
797 ${fct_test} 1 0 0 0 pid
798 clean_path
$TRACE_PATH
801 # Clear with tracing active, clear twice
802 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
804 SESSION_NAME
=$
(randstring
16 0)
805 ${fct_test} 1 1 0 0 pid
806 clean_path
$TRACE_PATH
809 # Clear with tracing inactive, clear once
810 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
812 SESSION_NAME
=$
(randstring
16 0)
813 ${fct_test} 0 0 0 0 pid
814 clean_path
$TRACE_PATH
817 # Clear with tracing inactive, clear twice
818 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
820 SESSION_NAME
=$
(randstring
16 0)
821 ${fct_test} 0 1 0 0 pid
822 clean_path
$TRACE_PATH
825 # Clear with tracing inactive, rotate-clear once
826 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
828 SESSION_NAME
=$
(randstring
16 0)
829 ${fct_test} 0 0 1 0 pid
830 clean_path
$TRACE_PATH
833 # Clear with tracing inactive, clear once-rotate(fail)
834 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
836 SESSION_NAME
=$
(randstring
16 0)
837 ${fct_test} 0 0 0 1 pid
838 clean_path
$TRACE_PATH
844 test_ust_disallow_clear