2013-07-09 13:56:19 +00:00
|
|
|
#
|
|
|
|
# \brief Test to start threads on all available CPUs
|
|
|
|
# \author Norman Feske
|
2014-03-06 12:15:49 +00:00
|
|
|
# \author Alexander Boettcher
|
2013-07-09 13:56:19 +00:00
|
|
|
#
|
|
|
|
|
2014-03-06 12:15:49 +00:00
|
|
|
if {
|
2017-03-02 12:08:07 +00:00
|
|
|
![have_spec arndale] &&
|
|
|
|
![have_spec wand_quad] &&
|
|
|
|
![have_spec panda] &&
|
|
|
|
![expr [have_spec x86_32] && [have_spec foc] ] &&
|
|
|
|
![expr [have_spec x86_64] && [have_spec foc] ] &&
|
2017-08-07 15:55:15 +00:00
|
|
|
![have_spec nova] &&
|
|
|
|
![have_spec sel4]
|
2014-03-06 12:15:49 +00:00
|
|
|
} {
|
2013-07-09 13:56:19 +00:00
|
|
|
puts "Platform is unsupported."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-20 12:37:59 +00:00
|
|
|
set build_components { core init test/affinity }
|
|
|
|
|
2015-09-03 12:55:05 +00:00
|
|
|
lappend_if [have_spec arndale] build_components drivers/platform
|
2014-05-20 12:37:59 +00:00
|
|
|
|
|
|
|
build $build_components
|
2013-03-21 11:51:25 +00:00
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2014-05-20 12:37:59 +00:00
|
|
|
set config {
|
2013-03-21 11:51:25 +00:00
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="CPU"/>
|
2017-01-18 16:10:07 +00:00
|
|
|
<service name="PD"/>
|
2014-05-20 12:37:59 +00:00
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IO_MEM"/>
|
2013-03-21 11:51:25 +00:00
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> </any-service>
|
2017-05-07 20:36:11 +00:00
|
|
|
</default-route>
|
|
|
|
<default caps="100"/>}
|
2014-05-20 12:37:59 +00:00
|
|
|
|
2015-09-03 12:55:05 +00:00
|
|
|
append_if [have_spec arndale] config {
|
2014-05-20 12:37:59 +00:00
|
|
|
<start name="platform_drv">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Regulator"/></provides>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append config {
|
2013-03-21 11:51:25 +00:00
|
|
|
<start name="test-affinity">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
</start>
|
2014-05-20 12:37:59 +00:00
|
|
|
</config> }
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2016-12-01 18:00:11 +00:00
|
|
|
set boot_modules { core ld.lib.so init test-affinity }
|
2014-05-20 12:37:59 +00:00
|
|
|
|
2015-09-03 12:55:05 +00:00
|
|
|
lappend_if [have_spec arndale] boot_modules platform_drv
|
2013-03-21 11:51:25 +00:00
|
|
|
|
2014-05-20 12:37:59 +00:00
|
|
|
build_boot_image $boot_modules
|
2013-03-21 11:51:25 +00:00
|
|
|
|
2015-01-08 21:09:08 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
2013-08-07 20:16:58 +00:00
|
|
|
set want_cpus_x 4
|
|
|
|
set want_cpus_y 1
|
|
|
|
set want_cpus_total [expr $want_cpus_x*$want_cpus_y]
|
|
|
|
set rounds "03"
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args "-nographic -smp $want_cpus_total,cores=$want_cpus_total "
|
2013-07-09 13:56:19 +00:00
|
|
|
} else {
|
|
|
|
set rounds "10"
|
|
|
|
if {[have_spec x86]} { set rounds "40" }
|
|
|
|
}
|
|
|
|
|
2015-03-18 13:57:16 +00:00
|
|
|
run_genode_until "Round $rounds:.*\n" 120
|
2013-07-09 13:56:19 +00:00
|
|
|
|
2015-03-18 13:57:16 +00:00
|
|
|
set cpus [regexp -inline {Detected [0-9x]+ CPU[s\.]} $output]
|
2013-08-07 20:16:58 +00:00
|
|
|
set cpus [regexp -all -inline {[0-9]+} $cpus]
|
|
|
|
set cpus [expr [lindex $cpus 0] * [lindex $cpus 1]]
|
2013-07-09 13:56:19 +00:00
|
|
|
|
2015-01-08 21:09:08 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
2013-08-07 20:16:58 +00:00
|
|
|
if {$want_cpus_total != $cpus} {
|
|
|
|
puts "CPU count is not as expected: $want_cpus_total != $cpus"
|
2013-07-09 13:56:19 +00:00
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-26 10:31:28 +00:00
|
|
|
set good_string {}
|
|
|
|
for {set r 0} {$r <= $rounds} {incr r} {
|
|
|
|
append good_string {[init -> test-affinity] Round }
|
|
|
|
append good_string [format "%02d" $r]
|
|
|
|
append good_string ":"
|
|
|
|
for {set i 0} {$i < $cpus} {incr i} {
|
|
|
|
append good_string " A"
|
|
|
|
}
|
|
|
|
append good_string "\n"
|
2013-07-09 13:56:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
grep_output {\[init -\> test-affinity\] Round}
|
2013-03-21 11:51:25 +00:00
|
|
|
|
2013-07-09 13:56:19 +00:00
|
|
|
compare_output_to $good_string
|