diff --git a/ports/run/noux.run b/ports/run/noux.run index 90def653c..5dd4c113d 100644 --- a/ports/run/noux.run +++ b/ports/run/noux.run @@ -42,7 +42,7 @@ install_config { - + diff --git a/ports/run/noux_fork.run b/ports/run/noux_fork.run index c3f74dc0d..06bf7264b 100644 --- a/ports/run/noux_fork.run +++ b/ports/run/noux_fork.run @@ -41,7 +41,7 @@ install_config { - + diff --git a/ports/run/noux_tool_chain.inc b/ports/run/noux_tool_chain.inc index 69de47e98..dce4c80a9 100644 --- a/ports/run/noux_tool_chain.inc +++ b/ports/run/noux_tool_chain.inc @@ -183,10 +183,19 @@ append config { +} + +append config { - - } +} + +if {![info exists verbose_mode]} {set verbose_mode "yes"} +append config " " + +append config { + +} foreach pkg $noux_pkgs { append config " " } diff --git a/ports/run/noux_tool_chain_auto.run b/ports/run/noux_tool_chain_auto.run index f62a7e518..e3fe0e5a6 100644 --- a/ports/run/noux_tool_chain_auto.run +++ b/ports/run/noux_tool_chain_auto.run @@ -23,6 +23,7 @@ set platform_cmds { make core && exit 234 } +set verbose_mode "no" source ${genode_dir}/ports/run/noux_tool_chain.inc diff --git a/ports/src/noux/child.h b/ports/src/noux/child.h index 588ea47e8..45c8092f9 100644 --- a/ports/src/noux/child.h +++ b/ports/src/noux/child.h @@ -270,7 +270,8 @@ namespace Noux { Rpc_entrypoint &resources_ep, bool forked, Allocator *destruct_alloc, - Destruct_queue &destruct_queue) + Destruct_queue &destruct_queue, + bool verbose) : Family_member(pid, parent), Destruct_queue::Element(destruct_alloc), @@ -303,7 +304,8 @@ namespace Noux { _entrypoint, _local_noux_service, _local_rm_service, _local_rom_service, _parent_services, - *this, *this, _destruct_context_cap, _resources.ram), + *this, *this, _destruct_context_cap, + _resources.ram, verbose), _child(forked ? Dataspace_capability() : _binary_ds, _resources.ram.cap(), _resources.cpu.cap(), _resources.rm.cap(), &_entrypoint, &_child_policy, @@ -312,7 +314,8 @@ namespace Noux { */ _local_ram_service, _local_cpu_service, _local_rm_service) { - _args.dump(); + if (verbose) + _args.dump(); if (!forked && !_binary_ds.valid()) { PERR("Lookup of executable \"%s\" failed", name); diff --git a/ports/src/noux/child_policy.h b/ports/src/noux/child_policy.h index da3d77e1e..481069b10 100644 --- a/ports/src/noux/child_policy.h +++ b/ports/src/noux/child_policy.h @@ -45,6 +45,7 @@ namespace Noux { File_descriptor_registry &_file_descriptor_registry; Signal_context_capability _destruct_context_cap; Ram_session &_ref_ram_session; + bool _verbose; public: @@ -60,7 +61,8 @@ namespace Noux { Family_member &family_member, File_descriptor_registry &file_descriptor_registry, Signal_context_capability destruct_context_cap, - Ram_session &ref_ram_session) + Ram_session &ref_ram_session, + bool verbose) : _name(strncpy(_name_buf, name, sizeof(_name_buf))), _labeling_policy(_name), @@ -74,7 +76,8 @@ namespace Noux { _family_member(family_member), _file_descriptor_registry(file_descriptor_registry), _destruct_context_cap(destruct_context_cap), - _ref_ram_session(ref_ram_session) + _ref_ram_session(ref_ram_session), + _verbose(verbose) { } const char *name() const { return _name; } @@ -119,7 +122,8 @@ namespace Noux { void exit(int exit_value) { - PINF("child %s exited with exit value %d", _name, exit_value); + if (_verbose || (exit_value != 0)) + PERR("child %s exited with exit value %d", _name, exit_value); /* * Close all open file descriptors. This is necessary to unblock diff --git a/ports/src/noux/cpu_session_component.h b/ports/src/noux/cpu_session_component.h index 4da391523..789961673 100644 --- a/ports/src/noux/cpu_session_component.h +++ b/ports/src/noux/cpu_session_component.h @@ -84,7 +84,6 @@ namespace Noux { } _main_thread = _cpu.create_thread(name, utcb); - PINF("created main thread"); return _main_thread; } diff --git a/ports/src/noux/main.cc b/ports/src/noux/main.cc index e535104a7..30b163ddb 100644 --- a/ports/src/noux/main.cc +++ b/ports/src/noux/main.cc @@ -31,8 +31,9 @@ #include +static const bool verbose_quota = false; static bool trace_syscalls = false; -static bool verbose_quota = false; +static bool verbose = false; namespace Noux { @@ -291,7 +292,8 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) _resources.ep, false, env()->heap(), - _destruct_queue); + _destruct_queue, + verbose); /* replace ourself by the new child at the parent */ parent()->remove(this); @@ -507,7 +509,8 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) _resources.ep, true, env()->heap(), - _destruct_queue); + _destruct_queue, + verbose); Family_member::insert(child); @@ -543,7 +546,8 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) _sysio->wait4_out.status = exited->exit_status(); Family_member::remove(exited); - PINF("submit exit signal for PID %d", exited->pid()); + if (verbose) + PINF("submit exit signal for PID %d", exited->pid()); static_cast(exited)->submit_exit_signal(); } else { @@ -871,6 +875,9 @@ int main(int argc, char **argv) try { trace_syscalls = config()->xml_node().attribute("trace_syscalls").has_value("yes"); } catch (Xml_node::Nonexistent_attribute) { } + try { + verbose = config()->xml_node().attribute("verbose").has_value("yes"); + } catch (Xml_node::Nonexistent_attribute) { } /* initialize virtual file system */ static Dir_file_system @@ -907,7 +914,8 @@ int main(int argc, char **argv) resources_ep, false, env()->heap(), - destruct_queue); + destruct_queue, + verbose); /* * I/O channels must be dynamically allocated to handle cases where the