From 8ed489c4bc0c1d29242b8bdf77a117a8e3ce4ecf Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Wed, 19 Sep 2012 12:17:22 +0200 Subject: [PATCH] libc: Decrease noise level of debugging output Changed 'libc_fs', 'libc_lwip' and 'libc/clock_gettime' --- libports/src/lib/libc/clock_gettime.cc | 3 --- libports/src/lib/libc_fs/plugin.cc | 26 ++++++++++++++++---------- libports/src/lib/libc_lwip/plugin.cc | 1 - 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libports/src/lib/libc/clock_gettime.cc b/libports/src/lib/libc/clock_gettime.cc index 11d7b78a46..9cc592e2ed 100644 --- a/libports/src/lib/libc/clock_gettime.cc +++ b/libports/src/lib/libc/clock_gettime.cc @@ -19,9 +19,6 @@ extern "C" __attribute__((weak)) int clock_gettime(clockid_t clk_id, struct timespec *tp) { - if (clk_id != CLOCK_MONOTONIC) - PWRN("Unsupported clk_id, using CLOCK_MONOTONIC instead."); - Genode::Alarm::Time time = Genode::Timeout_thread::alarm_timer()->time(); if (tp) { diff --git a/libports/src/lib/libc_fs/plugin.cc b/libports/src/lib/libc_fs/plugin.cc index 1a455a223f..9bfc2fe58f 100644 --- a/libports/src/lib/libc_fs/plugin.cc +++ b/libports/src/lib/libc_fs/plugin.cc @@ -176,7 +176,9 @@ static inline Plugin_context *context(Libc::File_descriptor *fd) static void wait_for_acknowledgement(File_system::Session::Tx::Source &source) { ::File_system::Packet_descriptor packet = source.get_acked_packet(); - PDBG("got acknowledgement for packet of size %zd", packet.size()); + + if (verbose) + PDBG("got acknowledgement for packet of size %zd", packet.size()); static_cast(packet.ref())->in_flight = false; @@ -224,7 +226,7 @@ static void obtain_stat_for_node(File_system::Node_handle node_handle, buf->st_mtime = mktime(&tm); - if (buf->st_mtime == -1) + if (buf->st_mtime == -1 && verbose) PERR("mktime() returned -1, the file modification time reported by stat() will be incorrect"); } @@ -317,7 +319,8 @@ class Plugin : public Libc::Plugin { /* wait for the completion of all operations of the context */ while (context(fd)->in_flight) { - PDBG("wait_for_acknowledgement"); + if (verbose) + PDBG("wait_for_acknowledgement"); wait_for_acknowledgement(*file_system()->tx()); } @@ -331,7 +334,6 @@ class Plugin : public Libc::Plugin int fcntl(Libc::File_descriptor *, int cmd, long arg) { - PDBG("not implemented"); /* libc's opendir() fails if fcntl() returns -1, so we return 0 here */ if (verbose) PDBG("fcntl() called - not yet implemented"); @@ -353,7 +355,6 @@ class Plugin : public Libc::Plugin int fstatfs(Libc::File_descriptor *, struct statfs *buf) { - PDBG("not implemented"); /* libc's opendir() fails if _fstatfs() returns -1, so we return 0 here */ if (verbose) PDBG("_fstatfs() called - not yet implemented"); @@ -362,7 +363,8 @@ class Plugin : public Libc::Plugin int fsync(Libc::File_descriptor *fd) { - PDBG("not implemented"); + if (verbose) + PDBG("not implemented"); return -1; } @@ -495,7 +497,8 @@ class Plugin : public Libc::Plugin * Probe for an existing directory to open */ try { - PDBG("open dir '%s'", path.str); + if (verbose) + PDBG("open dir '%s'", path.str); File_system::Dir_handle const handle = file_system()->dir(path.str, false); @@ -572,7 +575,8 @@ class Plugin : public Libc::Plugin int rename(const char *oldpath, const char *newpath) { - PDBG("not implemented"); + if (verbose) + PDBG("not implemented"); return -1; } @@ -647,7 +651,8 @@ class Plugin : public Libc::Plugin int stat(const char *pathname, struct stat *buf) { - PDBG("stat %s", pathname); + if (verbose) + PDBG("stat %s", pathname); Canonical_path path(pathname); try { @@ -713,7 +718,8 @@ class Plugin : public Libc::Plugin } } - PDBG("write returns %zd", count); + if (verbose) + PDBG("write returns %zd", count); return count; } diff --git a/libports/src/lib/libc_lwip/plugin.cc b/libports/src/lib/libc_lwip/plugin.cc index 4d580be446..5f3a8b3090 100644 --- a/libports/src/lib/libc_lwip/plugin.cc +++ b/libports/src/lib/libc_lwip/plugin.cc @@ -272,7 +272,6 @@ Libc::File_descriptor *Plugin::accept(Libc::File_descriptor *sockfdo, int lwip_fd = lwip_accept(get_lwip_fd(sockfdo), (struct lwip_sockaddr*)addr, addrlen); if (lwip_fd == -1) { - PERR("lwip_accept() failed"); return 0; }