mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
Config option for GDB monitor RAM preservation
This patch allows to configure the amount of RAM that GDB monitor should
preserve for itself. The configuration syntax looks as follows:
<start name="gdb_monitor">
<resource name="RAM" quantum="1G"/>
<config>
<target name="noux">
<preserve name="RAM" quantum="2M"/>
...
</config>
</start>
Fixes #190.
This commit is contained in:
committed by
Norman Feske
parent
3236395e6a
commit
93faa9a36f
@@ -63,7 +63,10 @@ set config {
|
|||||||
<start name="gdb_monitor">
|
<start name="gdb_monitor">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<provides><service name="Nitpicker"/></provides>
|
<provides><service name="Nitpicker"/></provides>
|
||||||
<config><target name="nitpicker"/></config>
|
<config>
|
||||||
|
<target name="nitpicker"/>
|
||||||
|
<preserve name="RAM" quantum="2M"/>
|
||||||
|
</config>
|
||||||
</start>
|
</start>
|
||||||
<start name="scout">
|
<start name="scout">
|
||||||
<resource name="RAM" quantum="32M"/>
|
<resource name="RAM" quantum="32M"/>
|
||||||
|
|||||||
@@ -59,7 +59,10 @@ set config {
|
|||||||
</start>
|
</start>
|
||||||
<start name="gdb_monitor">
|
<start name="gdb_monitor">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<config> <target name="test-gdb_monitor" /> </config>
|
<config>
|
||||||
|
<target name="test-gdb_monitor"/>
|
||||||
|
<preserve name="RAM" quantum="2M"/>
|
||||||
|
</config>
|
||||||
</start>
|
</start>
|
||||||
</config>
|
</config>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,10 @@ set config {
|
|||||||
</start>
|
</start>
|
||||||
<start name="gdb_monitor">
|
<start name="gdb_monitor">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<config> <target name="test-gdb_monitor" /> </config>
|
<config>
|
||||||
|
<target name="test-gdb_monitor"/>
|
||||||
|
<preserve name="RAM" quantum="2M"/>
|
||||||
|
</config>
|
||||||
</start>
|
</start>
|
||||||
</config>
|
</config>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ set config {
|
|||||||
<test_config_subnode/>
|
<test_config_subnode/>
|
||||||
</config>
|
</config>
|
||||||
</target>
|
</target>
|
||||||
|
<preserve name="RAM" quantum="2M"/>
|
||||||
</config>
|
</config>
|
||||||
</start>
|
</start>
|
||||||
</config>
|
</config>
|
||||||
|
|||||||
@@ -65,8 +65,23 @@ int main()
|
|||||||
/* extract target node from config file */
|
/* extract target node from config file */
|
||||||
Xml_node target_node = config()->xml_node().sub_node("target");
|
Xml_node target_node = config()->xml_node().sub_node("target");
|
||||||
|
|
||||||
/* reserve some memory for gdb_monitor and give the rest to the child */
|
/*
|
||||||
Number_of_bytes ram_quota = env()->ram_session()->avail() - 2*1024*1024;
|
* preserve the configured amount of memory for gdb_monitor and give the
|
||||||
|
* remainder to the child
|
||||||
|
*/
|
||||||
|
Number_of_bytes preserved_ram_quota = 0;
|
||||||
|
try {
|
||||||
|
Xml_node preserve_node = config()->xml_node().sub_node("preserve");
|
||||||
|
if (preserve_node.attribute("name").has_value("RAM"))
|
||||||
|
preserve_node.attribute("quantum").value(&preserved_ram_quota);
|
||||||
|
else
|
||||||
|
throw Xml_node::Exception();
|
||||||
|
} catch (...) {
|
||||||
|
PERR("Error: could not find a valid <preserve> config node");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Number_of_bytes ram_quota = env()->ram_session()->avail() - preserved_ram_quota;
|
||||||
|
|
||||||
/* start the application */
|
/* start the application */
|
||||||
char *unique_name = filename;
|
char *unique_name = filename;
|
||||||
|
|||||||
Reference in New Issue
Block a user