X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;fp=tests%2Futils%2Futils.sh;h=89624a4216f952095d8b42be4b754e7a791a886f;hb=fe1c64c5d431a7944bd68fb7b0e7e4e86058baa0;hp=09c4ae28d502ea8459a9ea13c57431657b8f4f54;hpb=f33e65faf5e4ffa7d249f58bf6dbdaf2bcb28693;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 09c4ae28d..89624a421 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -198,6 +198,16 @@ function get_exposed_cpus_list() echo "${list[@]}" } +# Return any available CPU found. Do not make assumption about the returned +# value, e.g. that it could be 0. +function get_any_available_cpu() +{ + for cpu in /sys/devices/system/cpu/cpu[0-9]*; do + echo "${cpu#/sys/devices/system/cpu/cpu}" + break; + done +} + # Return the number of _configured_ CPUs. function conf_proc_count() {