Signed-off-by: Stanislav Kholmanskikh <[email protected]>
---
.../cpu_hotplug/include/cpuhotplug_hotplug.sh | 22 ++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
index f553d0c..558ef12 100644
--- a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
@@ -131,6 +131,28 @@ get_all_cpus()
sed "s/\/sys\/devices\/system\/cpu\///g" || return 2
}
+# get_hotplug_cpus()
+#
+# Prints a list of all hotpluggable CPUs
+#
+get_hotplug_cpus()
+{
+ ls /sys/devices/system/cpu/cpu[0-9]*/online 2> /dev/null | \
+ sed "s/\/sys\/devices\/system\/cpu\/\(cpu[0-9]*\)\/online/\1/g" ||
return 2
+}
+
+# get_hotplug_cpus_num()
+#
+# Prints the number of hotpluggable CPUs
+#
+get_hotplug_cpus_num()
+{
+ hotplug_cpus=$(get_hotplug_cpus)
+ ret=$?
+ [ $ret -ne 0 ] && return 0
+
+ return $(echo "$hotplug_cpus" | grep -c 'cpu')
+}
# get_all_cpu_states()
#
--
1.7.1
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list