mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-25 05:19:57 +00:00
85 lines
1.9 KiB
Plaintext
85 lines
1.9 KiB
Plaintext
assert {[have_spec foc] ||
|
|
[have_spec hw] ||
|
|
[have_spec nova] ||
|
|
[have_spec okl4] ||
|
|
[have_spec sel4]}
|
|
|
|
set build_components {
|
|
core lib/ld init timer
|
|
server/cpu_sampler lib/cpu_sampler_platform
|
|
test/cpu_sampler
|
|
}
|
|
|
|
if {[have_spec foc] || [have_spec nova]} {
|
|
lappend build_components lib/cpu_sampler_platform-$::env(KERNEL)
|
|
} else {
|
|
lappend build_components lib/cpu_sampler_platform-generic
|
|
}
|
|
|
|
build $build_components
|
|
|
|
create_boot_directory
|
|
|
|
install_config {
|
|
<config>
|
|
<parent-provides>
|
|
<service name="CPU"/>
|
|
<service name="IO_PORT"/>
|
|
<service name="IO_MEM"/>
|
|
<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>
|
|
<default caps="100" ram="1M"/>
|
|
<start name="timer">
|
|
<provides>
|
|
<service name="Timer"/>
|
|
</provides>
|
|
</start>
|
|
<start name="cpu_sampler" ram="4M">
|
|
<provides>
|
|
<service name="CPU"/>
|
|
</provides>
|
|
<config sample_interval_ms="100" sample_duration_s="1">
|
|
<policy label="test-cpu_sampler -> ep" />
|
|
</config>
|
|
</start>
|
|
<start name="test-cpu_sampler">
|
|
<config ld_verbose="yes"/>
|
|
<route>
|
|
<service name="CPU"> <child name="cpu_sampler"/> </service>
|
|
<any-service> <parent/> </any-service>
|
|
</route>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
#
|
|
# Boot modules
|
|
#
|
|
|
|
# evaluated by the run tool
|
|
proc binary_name_cpu_sampler_platform_lib_so { } {
|
|
if {[have_spec foc] || [have_spec nova]} {
|
|
return "cpu_sampler_platform-$::env(KERNEL).lib.so"
|
|
} else {
|
|
return "cpu_sampler_platform-generic.lib.so"
|
|
}
|
|
}
|
|
|
|
build_boot_image [build_artifacts]
|
|
|
|
append qemu_args "-nographic "
|
|
|
|
set match_string "Test started. func: 0x(\[0-9a-f\]+).*\n"
|
|
|
|
run_genode_until "$match_string" 30
|
|
|
|
regexp $match_string $output all func
|
|
|
|
run_genode_until "\\\[init -> cpu_sampler -> samples -> test-cpu_sampler -> ep\\\.1] \[0\]*$func" 2 [output_spawn_id]
|