2016-08-24 15:23:06 +00:00
|
|
|
if { ![have_spec foc] && ![have_spec hw] && ![have_spec nova] &&
|
|
|
|
![have_spec okl4] && ![have_spec sel4] } {
|
|
|
|
puts "Run script is not supported on this platform"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2017-02-26 00:17:22 +00:00
|
|
|
set build_components {
|
2016-08-24 15:23:06 +00:00
|
|
|
core
|
|
|
|
init
|
|
|
|
drivers/timer
|
|
|
|
server/cpu_sampler
|
|
|
|
test/cpu_sampler
|
|
|
|
}
|
|
|
|
|
2017-02-27 18:54:03 +00:00
|
|
|
if {[have_spec foc] || [have_spec nova]} {
|
|
|
|
lappend build_components lib/cpu_sampler_platform-$::env(KERNEL)
|
2017-02-26 00:17:22 +00:00
|
|
|
} else {
|
|
|
|
lappend build_components lib/cpu_sampler_platform-generic
|
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
2016-08-24 15:23:06 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="IO_PORT"/>
|
2017-07-04 12:17:38 +00:00
|
|
|
<service name="IO_MEM"/>
|
2016-08-24 15:23:06 +00:00
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="ROM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2016-08-24 15:23:06 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Timer"/>
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
<start name="cpu_sampler">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="CPU"/>
|
|
|
|
</provides>
|
|
|
|
<config sample_interval_ms="100" sample_duration_s="1">
|
2017-02-26 01:35:07 +00:00
|
|
|
<policy label="test-cpu_sampler -> ep" />
|
2016-08-24 15:23:06 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
2017-02-26 01:35:07 +00:00
|
|
|
<start name="test-cpu_sampler">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<config ld_verbose="yes"/>
|
2016-08-24 15:23:06 +00:00
|
|
|
<route>
|
|
|
|
<service name="CPU"> <child name="cpu_sampler"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
2017-02-26 00:17:22 +00:00
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# evaluated by the run tool
|
|
|
|
proc binary_name_cpu_sampler_platform_lib_so { } {
|
2017-02-27 18:54:03 +00:00
|
|
|
if {[have_spec foc] || [have_spec nova]} {
|
|
|
|
return "cpu_sampler_platform-$::env(KERNEL).lib.so"
|
2017-02-26 00:17:22 +00:00
|
|
|
} else {
|
|
|
|
return "cpu_sampler_platform-generic.lib.so"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image {
|
|
|
|
core ld.lib.so init timer
|
|
|
|
cpu_sampler cpu_sampler_platform.lib.so
|
|
|
|
test-cpu_sampler
|
|
|
|
}
|
2016-08-24 15:23:06 +00:00
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args "-nographic "
|
2016-08-24 15:23:06 +00:00
|
|
|
|
|
|
|
set match_string "Test started. func: 0x(\[0-9a-f\]+).*\n"
|
|
|
|
|
|
|
|
run_genode_until "$match_string" 10
|
|
|
|
|
|
|
|
regexp $match_string $output all func
|
|
|
|
|
2017-02-26 01:35:07 +00:00
|
|
|
run_genode_until "\\\[init -> cpu_sampler -> samples -> test-cpu_sampler -> ep\\\.1] \[0\]*$func" 2 [output_spawn_id]
|