USERSPACE_PROBE_ELF_TESTAPP_NAME=${USERSPACE_PROBE_ELF_TESTAPP_NAME:-"userspace-probe-elf-binary"}
USERSPACE_PROBE_ELF_TESTAPP_BIN=${USERSPACE_PROBE_ELF_TESTAPP_BIN:-"$TESTAPP_PATH/$USERSPACE_PROBE_ELF_TESTAPP_NAME/.libs/$USERSPACE_PROBE_ELF_TESTAPP_NAME"}
+# shellcheck source=../utils/utils.sh
+source "$GENERATOR_TESTDIR/utils/utils.sh"
+
function generate_filter_events
{
local nr=$1
local nr=$1
shift
- for i in $(seq 1 "$nr"); do
+ for _ in $(seq 1 "$nr"); do
# Pass /dev/null so to generate the syscall right away.
$SYSCALL_TESTAPP_BIN /dev/null "$@"
done
local nr=$1
shift
- for i in $(seq 1 "$nr"); do
+ for _ in $(seq 1 "$nr"); do
# This userspace probe test has to instrument the actual elf
# binary and not the generated libtool wrapper. However, we
# can't invoke the wrapper either since it will re-link the test
run=true
sleep 0.5
elif [ "$run" = true ]; then
- taskset -c 0 "$test_app" -i "$nr_iter" -w "$nr_usec_wait" "$@"> /dev/null 2>&1
+ taskset -c "$(get_any_available_cpu)" "$test_app" -i "$nr_iter" -w "$nr_usec_wait" "$@"> /dev/null 2>&1
run=false;
if [[ -f $state_file ]]; then
rm -rf "$state_file" 2> /dev/null
# Reset the "run" state
sleep 0.5
else
- taskset -c 0 "$test_app" -i $nr_iter -w $nr_usec_wait "$@" > /dev/null 2>&1
+ taskset -c "$(get_any_available_cpu)" "$test_app" -i $nr_iter -w $nr_usec_wait "$@" > /dev/null 2>&1
if [[ -f $state_file ]]; then
rm -rf "$state_file" 2> /dev/null
fi