base-*: remove usage of printf

base generic code:
  * Remove unused verbosity code from mmio framework
  * Remove escape sequence end heuristic from LOG
  * replace Core_console with Core_log (no format specifiers)
  * move test/printf to test/log
  * remove `printf()` tests from the log test
  * check for exact match of the log test output
base-fiasco:
  * remove unused Fiasco::print_l4_threadid function
base-nova:
  * remove unused hexdump utility from core
base-hw:
  * remove unused Kernel::Thread::_print_* debug utilities
  * always print resource summary of core during startup
  * remove Kernel::Ipc_node::pd_label (not used anymore)
base*:
  * Turn `printf`,`PWRN`, etc. calls into their log equivalents

Ref #1987
Fix #2119
This commit is contained in:
Stefan Kalkowski
2016-10-10 16:22:43 +02:00
committed by Christian Helmuth
parent e864e84c5a
commit 2a2e5c2df4
126 changed files with 639 additions and 1020 deletions

View File

@ -0,0 +1,20 @@
/*
* \brief Kernel-specific core's 'log' backend
* \author Stefan Kalkowski
* \date 2016-10-10
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* core includes */
#include <core_log.h>
/* Linux syscall bindings */
#include <linux_syscalls.h>
void Genode::Core_log::out(char const c) { lx_write(1, &c, sizeof(c)); }

View File

@ -207,7 +207,7 @@ namespace Genode {
Cpu_session_capability cpu_session_cap() override
{
PWRN("%s:%u not implemented", __FILE__, __LINE__);
warning(__FILE__, ":", __LINE__, " not implemented");
return Cpu_session_capability();
}
};

View File

@ -23,7 +23,6 @@
#include <util/string.h>
#include <util/misc_math.h>
#include <base/rpc_server.h>
#include <base/printf.h>
/* base-internal includes */
#include <base/internal/capability_space_tpl.h>
@ -79,7 +78,7 @@ namespace Genode {
:
_size(size), _addr(phys_addr), _fd(-1), _owner(_owner)
{
PWRN("Should only be used for IOMEM and not within Linux.");
warning("Should only be used for IOMEM and not within Linux.");
_fname.buf[0] = 0;
}

View File

@ -16,7 +16,6 @@
/* Genode includes */
#include <base/allocator.h>
#include <base/printf.h>
#include <base/rpc_server.h>
#include <io_mem_session/io_mem_session.h>

View File

@ -11,7 +11,7 @@
* under the terms of the GNU General Public License version 2.
*/
#include <base/printf.h>
#include <base/log.h>
#include <io_mem_session_component.h>
@ -21,7 +21,5 @@ using namespace Genode;
Io_mem_session_component::Io_mem_session_component(Range_allocator *io_mem_alloc,
Range_allocator *ram_alloc,
Rpc_entrypoint *ds_ep,
const char *args)
{
PWRN("no io_mem support on Linux (args=\"%s\")", args);
}
const char *args) {
warning("no io_mem support on Linux (args=\"", args, "\")"); }

View File

@ -14,7 +14,6 @@
/* Genode includes */
#include <rm_session/rm_session.h>
#include <ram_session/ram_session.h>
#include <base/printf.h>
#include <base/thread.h>
/* base-internal includes */
@ -64,8 +63,11 @@ class Stack_area_region_map : public Genode::Region_map
return local_addr;
}
void detach(Local_addr local_addr) {
PWRN("stack area detach from 0x%p - not implemented", (void *)local_addr); }
void detach(Local_addr local_addr)
{
Genode::warning("stack area detach from ", (void*)local_addr,
" - not implemented");
}
void fault_handler(Genode::Signal_context_capability) { }

View File

@ -27,7 +27,7 @@ SRC_CC = main.cc \
trace_session_component.cc \
thread_linux.cc \
stack_area.cc \
core_printf.cc \
core_log.cc \
default_log.cc \
env_reinit.cc \
thread.cc thread_myself.cc
@ -55,7 +55,6 @@ vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath trace_session_component.cc $(GEN_CORE_DIR)
vpath core_rpc_cap_alloc.cc $(GEN_CORE_DIR)
vpath default_log.cc $(GEN_CORE_DIR)
vpath core_printf.cc $(BASE_DIR)/src/lib/base
vpath thread.cc $(BASE_DIR)/src/lib/base
vpath thread_myself.cc $(BASE_DIR)/src/lib/base
vpath trace.cc $(BASE_DIR)/src/lib/base

View File

@ -1,35 +0,0 @@
/*
* \brief Printf backend using Linux stdout
* \author Norman Feske
* \date 2006-04-08
*
* This console back-end should only be used by core.
*/
/*
* Copyright (C) 2006-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__BASE__INTERNAL__CORE_CONSOLE_H_
#define _INCLUDE__BASE__INTERNAL__CORE_CONSOLE_H_
/* Genode includes */
#include <base/console.h>
/* Linux syscall bindings */
#include <linux_syscalls.h>
namespace Genode {
class Core_console : public Console
{
protected:
void _out_char(char c) { lx_write(1, &c, sizeof(c)); }
};
}
#endif /* _INCLUDE__BASE__INTERNAL__CORE_CONSOLE_H_ */

View File

@ -109,7 +109,6 @@ void Genode::call_global_static_constructors() { }
int main()
{
Genode::init_log();
Genode::bootstrap_component();
/* never reached */

View File

@ -13,7 +13,7 @@
/* Genode includes */
#include <base/component.h>
#include <base/printf.h>
#include <base/log.h>
/* local includes */
#include "testlib.h"
@ -28,7 +28,7 @@ struct Testapp_testclass
{
Testapp_testclass()
{
Genode::printf("Global static constructor of Genode application called\n");
Genode::log("Global static constructor of Genode application called");
}
void dummy() { }
@ -52,7 +52,7 @@ Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
*/
void Component::construct(Genode::Env &env)
{
printf("--- lx_hybrid global static constructor test ---\n");
log("--- lx_hybrid global static constructor test ---");
/*
* Call a dummy function on each test object to make sure that the
@ -61,7 +61,7 @@ void Component::construct(Genode::Env &env)
testlib_testobject.dummy();
testapp_testobject.dummy();
printf("--- returning from main ---\n");
log("--- returning from main ---");
exit_status = 0;
env.ep().schedule_suspend(exit_on_suspended, nullptr);
}

View File

@ -13,7 +13,7 @@
/* Genode includes */
#include <base/component.h>
#include <base/printf.h>
#include <base/log.h>
/* Linux includes */
#include <stdlib.h>
@ -35,16 +35,16 @@ Genode::size_t Component::stack_size() { return 16*1024*sizeof(long); }
*/
void Component::construct(Genode::Env &env)
{
printf("--- lx_hybrid exception test ---\n");
log("--- lx_hybrid exception test ---");
try {
printf("Throwing Test_exception\n");
log("Throwing Test_exception");
throw Test_exception();
} catch (Test_exception) {
printf("Caught Test_exception\n");
log("Caught Test_exception");
}
printf("--- returning from main ---\n");
log("--- returning from main ---");
exit_status = 0;
env.ep().schedule_suspend(exit_on_suspended, nullptr);
}