OLDCPUSET=$(taskset -p $$)
diag "Test local UST snapshots with small discard buffers"
- taskset -p 0x1 $$ 1>/dev/null 2>&1 # CPU 0 only
+ taskset -c "$(get_any_available_cpu)" -p $$ 1>/dev/null 2>&1
create_lttng_session_no_output $SESSION_NAME
enable_mmap_small_discard_ust_channel $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
OLDCPUSET=$(taskset -p $$)
diag "Test local UST snapshots with small overwrite buffers"
- taskset -p 0x1 $$ 1>/dev/null 2>&1 # CPU 0 only
+ taskset -p "$(get_any_available_cpu)" $$ 1>/dev/null 2>&1
create_lttng_session_no_output $SESSION_NAME
enable_mmap_small_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
function test_ust_local_snapshot_max_size ()
{
local possible_cpus
- local online_cpus
+ local cpus_list
local subbuf_size
local subbuf_count
local snapshot_max_size
local channel_max_size_per_cpu
+ IFS=" " read -r -a cpus_list <<< "$(get_online_cpus)"
+
possible_cpus=$(get_possible_cpus_count)
- online_cpus=$(conf_proc_count)
subbuf_size=$(getconf PAGE_SIZE)
subbuf_count=8
snapshot_max_size=$((subbuf_size*possible_cpus))
# Fill all ring-buffers of the channel; assuming event size of at least one
# byte
- for cpu in $(seq "$online_cpus");
+ for cpu in "${cpus_list[@]}";
do
- taskset --cpu-list $((cpu-1)) "$TESTAPP_BIN" \
+ diag "setting affinity to $cpu"
+ taskset --cpu-list "$cpu" "$TESTAPP_BIN" \
--iter "$channel_max_size_per_cpu"
done
diag "Filled channel ring-buffers"