Fix: Tests that assume CPU 0 is present
[lttng-tools.git] / tests / utils / utils.sh
index db1a307afb69ae07426b01b9bdce8358cffd7652..949ed131138865dc5c45e28be0e3984e28d110fe 100644 (file)
@@ -277,6 +277,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()
 {
This page took 0.022871 seconds and 4 git commands to generate.