gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 5a21156686cfc9048656f801387f5ea52a8a64c7
parent 21a13aae70e936935b47598fd59f71d345c23099
Author: Florian Dold <florian.dold@gmail.com>
Date:   Thu, 10 Dec 2015 10:59:25 +0000

Make resource diagnostics output more useful.

The old format had output that looked like a floating point number, but was
actually two integers (seconds, microseconds) separated by a dot.  Actually
outputting floating point numbers makes the output more amendable to processing
with standard tools like awk.


Diffstat:
Msrc/arm/gnunet-service-arm.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c @@ -1254,14 +1254,14 @@ maint_child_death (void *cls, if ( (GNUNET_OS_PROCESS_EXITED == statusType) || (GNUNET_OS_PROCESS_SIGNALED == statusType) ) { + double utime = ru.ru_utime.tv_sec + (ru.ru_utime.tv_usec / 10e6); + double stime = ru.ru_stime.tv_sec + (ru.ru_stime.tv_usec / 10e6); fprintf (wait_file, - "%s(%u) %llu.%llu %llu.%llu %llu %llu %llu %llu %llu\n", + "%s(%u) %.3f %.3f %llu %llu %llu %llu %llu\n", pos->binary, (unsigned int) pid, - (unsigned long long) ru.ru_utime.tv_sec, - (unsigned long long) ru.ru_utime.tv_usec, - (unsigned long long) ru.ru_stime.tv_sec, - (unsigned long long) ru.ru_stime.tv_usec, + utime, + stime, (unsigned long long) ru.ru_maxrss, (unsigned long long) ru.ru_inblock, (unsigned long long) ru.ru_oublock,