2013-07-09 13:56:19 +00:00
|
|
|
#
|
|
|
|
# \brief Test to start threads on all available CPUs
|
|
|
|
# \author Norman Feske
|
|
|
|
# \author Alexander Boettcher
|
|
|
|
#
|
|
|
|
|
|
|
|
if {![have_spec nova] && ![have_spec foc]} {
|
|
|
|
puts "Platform is unsupported."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-21 11:51:25 +00:00
|
|
|
build "core init test/affinity"
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
<start name="test-affinity">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image "core init test-affinity"
|
|
|
|
|
2013-07-09 13:56:19 +00:00
|
|
|
if {[is_qemu_available]} {
|
|
|
|
set want_cpus 4
|
|
|
|
set rounds "05"
|
|
|
|
append qemu_args "-nographic -m 64 -smp $want_cpus,cores=$want_cpus "
|
|
|
|
} else {
|
|
|
|
set rounds "10"
|
|
|
|
if {[have_spec x86]} { set rounds "40" }
|
|
|
|
}
|
|
|
|
|
|
|
|
run_genode_until "Round $rounds:.*\n" 90
|
|
|
|
|
|
|
|
set cpus [regexp -inline {Detected [0-9]+ CPU[ s].*\n} $output]
|
|
|
|
set cpus [regexp -inline {[0-9]+} $cpus]
|
|
|
|
|
|
|
|
if {[is_qemu_available]} {
|
|
|
|
if {$want_cpus != $cpus} {
|
|
|
|
puts "CPU count is not as expected: $want_cpus != $cpus"
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set good_string {[init -> test-affinity] Round XX:}
|
|
|
|
for {set i 0} {$i < $cpus} {incr i} {
|
|
|
|
append good_string " A"
|
|
|
|
}
|
|
|
|
|
|
|
|
grep_output {\[init -\> test-affinity\] Round}
|
|
|
|
unify_output {[0-9]+} "XX"
|
2013-03-21 11:51:25 +00:00
|
|
|
|
2013-07-09 13:56:19 +00:00
|
|
|
compare_output_to $good_string
|