2014-01-11 23:29:17 +00:00
|
|
|
build "core init server/report_rom test/report_rom drivers/timer"
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
2015-08-20 14:00:57 +00:00
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
2014-01-11 23:29:17 +00:00
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2014-01-11 23:29:17 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
2015-08-20 14:00:57 +00:00
|
|
|
<provides> <service name="ROM"/> <service name="Report"/> </provides>
|
|
|
|
<config>
|
2015-11-30 14:00:10 +00:00
|
|
|
<policy label_prefix="test-report_rom ->" label_suffix="brightness"
|
|
|
|
report="test-report_rom -> brightness"/>
|
2015-08-20 14:00:57 +00:00
|
|
|
</config>
|
2014-01-11 23:29:17 +00:00
|
|
|
</start>
|
|
|
|
<start name="test-report_rom">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<route>
|
2016-07-18 15:18:17 +00:00
|
|
|
<service name="ROM" label="brightness">
|
2015-08-20 14:00:57 +00:00
|
|
|
<child name="report_rom"/>
|
2014-01-11 23:29:17 +00:00
|
|
|
</service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
2016-12-01 18:00:11 +00:00
|
|
|
build_boot_image "core ld.lib.so init timer report_rom test-report_rom"
|
2014-01-11 23:29:17 +00:00
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args "-nographic "
|
2014-01-11 23:29:17 +00:00
|
|
|
|
2014-08-22 12:43:54 +00:00
|
|
|
run_genode_until {child "test-report_rom" exited with exit value 0.*\n} 30
|
2014-01-11 23:29:17 +00:00
|
|
|
|
2016-10-10 14:22:43 +00:00
|
|
|
grep_output {^\[init -> test-report_rom\] .+}
|
2016-04-15 13:19:22 +00:00
|
|
|
unify_output {\[init \-\> test\-report_rom\] upgrading quota donation for .* \([0-9]+ bytes\)} ""
|
|
|
|
trim_lines
|
2014-01-11 23:29:17 +00:00
|
|
|
|
|
|
|
compare_output_to {
|
|
|
|
[init -> test-report_rom] --- test-report_rom started ---
|
|
|
|
[init -> test-report_rom] Reporter: open session
|
|
|
|
[init -> test-report_rom] Reporter: brightness 10
|
|
|
|
[init -> test-report_rom] ROM client: request brightness report
|
2017-01-10 13:13:35 +00:00
|
|
|
[init -> test-report_rom] -> <brightness value="10"/>
|
2014-01-11 23:29:17 +00:00
|
|
|
[init -> test-report_rom] Reporter: updated brightness to 77
|
|
|
|
[init -> test-report_rom] ROM client: wait for update notification
|
|
|
|
[init -> test-report_rom] ROM client: got signal
|
|
|
|
[init -> test-report_rom] ROM client: request updated brightness report
|
2017-01-10 13:13:35 +00:00
|
|
|
[init -> test-report_rom] -> <brightness value="77"/>
|
|
|
|
[init -> test-report_rom] Reporter: close report session, wait a bit
|
|
|
|
[init -> test-report_rom] got timeout
|
|
|
|
[init -> test-report_rom] -> <brightness value="77"/>
|
2015-08-20 14:00:57 +00:00
|
|
|
[init -> test-report_rom] ROM client: ROM is available despite report was closed - OK
|
2014-01-11 23:29:17 +00:00
|
|
|
[init -> test-report_rom] Reporter: start reporting (while the ROM client still listens)
|
|
|
|
[init -> test-report_rom] ROM client: wait for update notification
|
2015-08-20 14:00:57 +00:00
|
|
|
[init -> test-report_rom] ROM client: try to open the same report again
|
Capability quota accounting and trading
This patch mirrors the accounting and trading scheme that Genode employs
for physical memory to the accounting of capability allocations.
Capability quotas must now be explicitly assigned to subsystems by
specifying a 'caps=<amount>' attribute to init's start nodes.
Analogously to RAM quotas, cap quotas can be traded between clients and
servers as part of the session protocol. The capability budget of each
component is maintained by the component's corresponding PD session at
core.
At the current stage, the accounting is applied to RPC capabilities,
signal-context capabilities, and dataspace capabilities. Capabilities
that are dynamically allocated via core's CPU and TRACE service are not
yet covered. Also, the capabilities allocated by resource multiplexers
outside of core (like nitpicker) must be accounted by the respective
servers, which is not covered yet.
If a component runs out of capabilities, core's PD service prints a
warning to the log. To observe the consumption of capabilities per
component in detail, the PD service is equipped with a diagnostic
mode, which can be enabled via the 'diag' attribute in the target
node of init's routing rules. E.g., the following route enables the
diagnostic mode for the PD session of the "timer" component:
<default-route>
<service name="PD" unscoped_label="timer">
<parent diag="yes"/>
</service>
...
</default-route>
For subsystems based on a sub-init instance, init can be configured
to report the capability-quota information of its subsystems by
adding the attribute 'child_caps="yes"' to init's '<report>'
config node. Init's own capability quota can be reported by adding
the attribute 'init_caps="yes"'.
Fixes #2398
2017-05-08 19:35:43 +00:00
|
|
|
[init -> test-report_rom] Error: Report-session creation failed (label="brightness", ram_quota=14336, cap_quota=3, buffer_size=4096)
|
Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.
Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.
This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-07 20:03:22 +00:00
|
|
|
[init -> test-report_rom] ROM client: caught Service_denied - OK
|
2014-01-11 23:29:17 +00:00
|
|
|
[init -> test-report_rom] --- test-report_rom finished ---
|
|
|
|
}
|