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

@@ -37,7 +37,7 @@ SRC_CC += \
capability_space.cc \
pager.cc
LIBS += core_printf base-common syscall
LIBS += core_log base-common syscall
INC_DIR += $(REP_DIR)/src/core/include $(GEN_CORE_DIR)/include \
$(REP_DIR)/src/include $(BASE_DIR)/src/include

View File

@@ -0,0 +1,6 @@
SRC_CC = core_log.cc default_log.cc
INC_DIR += $(REP_DIR)/src/include $(BASE_DIR)/src/include $(BASE_DIR)/src/core/include
LIBS += syscall
vpath core_log.cc $(REP_DIR)/src/core
vpath default_log.cc $(BASE_DIR)/src/core

View File

@@ -1,6 +0,0 @@
SRC_CC = core_printf.cc default_log.cc
INC_DIR += $(REP_DIR)/src/include $(BASE_DIR)/src/include
LIBS += syscall
vpath core_printf.cc $(BASE_DIR)/src/lib/base
vpath default_log.cc $(BASE_DIR)/src/core

View File

@@ -13,7 +13,6 @@
/* base includes */
#include <base/capability.h>
#include <base/printf.h>
/* base-internal includes */
#include <base/internal/capability_data.h>

View File

@@ -0,0 +1,21 @@
/*
* \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>
/* seL4 includes */
#include <sel4/arch/functions.h>
#include <sel4/arch/syscalls.h>
void Genode::Core_log::out(char const c) { seL4_DebugPutChar(c); }

View File

@@ -59,8 +59,8 @@ class Genode::Cnode_base
int const ret = seL4_CNode_Copy(service, dest_index, dest_depth,
src_root, src_index, src_depth, rights);
if (ret != 0) {
PWRN("%s: seL4_CNode_Copy (0x%lx) returned %d", __FUNCTION__,
from_idx.value(), ret);
warning(__FUNCTION__, ": seL4_CNode_Copy (",
(void*)from_idx.value(), ") returned ", ret);
}
}
@@ -112,8 +112,8 @@ class Genode::Cnode_base
int const ret = seL4_CNode_Move(service, dest_index, dest_depth,
src_root, src_index, src_depth);
if (ret != 0) {
PWRN("%s: seL4_CNode_Move (0x%lx) returned %d", __FUNCTION__,
from_idx.value(), ret);
warning(__FUNCTION__, ": seL4_CNode_Move (",
(void*)from_idx.value(), ") returned ", ret);
}
}

View File

@@ -14,9 +14,6 @@
#ifndef _CORE__INCLUDE__MAP_LOCAL_H_
#define _CORE__INCLUDE__MAP_LOCAL_H_
/* Genode includes */
#include <base/printf.h>
/* core includes */
#include <util.h>
#include <platform.h>

View File

@@ -14,9 +14,6 @@
#ifndef _CORE__INCLUDE__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
/* Genode includes */
#include <base/printf.h>
/* local includes */
#include <platform_generic.h>
#include <core_mem_alloc.h>

View File

@@ -17,9 +17,6 @@
#ifndef _CORE__INCLUDE__THREAD_SEL4_H_
#define _CORE__INCLUDE__THREAD_SEL4_H_
/* Genode includes */
#include <base/printf.h>
/* base-internal includes */
#include <base/internal/assert.h>

View File

@@ -14,10 +14,6 @@
#ifndef _CORE__INCLUDE__UTIL_H_
#define _CORE__INCLUDE__UTIL_H_
/* Genode includes */
#include <rm_session/rm_session.h>
#include <base/printf.h>
/* base-internal includes */
#include <base/internal/page_size.h>

View File

@@ -33,7 +33,7 @@ Native_capability Rpc_cap_factory::_alloc(Rpc_cap_factory *owner,
Native_capability ep)
{
if (!ep.valid()) {
PWRN("Invalid entrypoint capability");
warning("Invalid entrypoint capability");
return Native_capability();
}

View File

@@ -1,37 +0,0 @@
/*
* \brief Console backend for seL4
* \author Norman Feske
* \date 2014-10-14
*/
/*
* Copyright (C) 2014 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>
/* seL4 includes */
#include <sel4/arch/functions.h>
#include <sel4/arch/syscalls.h>
namespace Genode { class Core_console; }
class Genode::Core_console : public Console
{
protected:
void _out_char(char c)
{
seL4_DebugPutChar(c);
}
};
#endif /* _INCLUDE__BASE__INTERNAL__CORE_CONSOLE_H_ */

View File

@@ -13,7 +13,7 @@
/* base includes */
#include <base/capability.h>
#include <base/printf.h>
#include <base/log.h>
#include <util/bit_allocator.h>
/* base-internal includes */
@@ -156,7 +156,7 @@ void Capability_space::reset_sel(unsigned sel)
{
int ret = seL4_CNode_Delete(INITIAL_SEL_CNODE, sel, CSPACE_SIZE_LOG2);
if (ret != 0)
PWRN("seL4_CNode_Delete returned %d", ret);
warning("seL4_CNode_Delete returned ", ret);
}