[PATCH] daemon: proto: Remove pervasive but useless debugging messages.
If you spend your time looking at libguestfs debugging output you'll see many messages from the daemon main loop like this: guestfsd: main_loop: new request, len 0x54 guestfsd: main_loop: proc 278 (mkfs) took 0.02 seconds I don't think these messages really bring much value. This commit removes them entirely. An alternative might be to change them to make them shorter and/or less useless, but I'm not sure what that would be. Rich.
--- daemon/proto.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/daemon/proto.c b/daemon/proto.c index 14f7efe94..670ae2ffb 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -96,11 +96,6 @@ main_loop (int _sock) xdr_u_int (&xdr, &len); xdr_destroy (&xdr); - if (verbose) - fprintf (stderr, - "guestfsd: main_loop: new request, len 0x%" PRIx32 "\n", - len); - /* Cancellation sent from the library and received after the * previous request has finished processing. Just ignore it. */ @@ -188,26 +183,6 @@ main_loop (int _sock) /* Now start to process this message. */ dispatch_incoming_message (&xdr); /* Note that dispatch_incoming_message will also send a reply. */ - - /* In verbose mode, display the time taken to run each command. */ - if (verbose) { - struct timeval end_t; - gettimeofday (&end_t, NULL); - - int64_t start_us, end_us, elapsed_us; - start_us = (int64_t) start_t.tv_sec * 1000000 + start_t.tv_usec; - end_us = (int64_t) end_t.tv_sec * 1000000 + end_t.tv_usec; - elapsed_us = end_us - start_us; - - fprintf (stderr, - "guestfsd: main_loop: proc %d (%s) took %d.%02d seconds\n", - proc_nr, - proc_nr >= 0 && proc_nr <= GUESTFS_MAX_PROC_NR - ? function_names[proc_nr] : "UNKNOWN PROCEDURE", - (int) (elapsed_us / 1000000), - (int) ((elapsed_us / 10000) % 100)); - } - cont: xdr_destroy (&xdr); free (buf); -- 2.13.2
On Monday, 9 October 2017 18:20:53 CEST Richard W.M. Jones wrote:
If you spend your time looking at libguestfs debugging output you'll see many messages from the daemon main loop like this:
guestfsd: main_loop: new request, len 0x54 guestfsd: main_loop: proc 278 (mkfs) took 0.02 seconds
I don't think these messages really bring much value. This commit removes them entirely.
TBH these information were useful to me in the past: a) the request length made me discover that a locally generated file, uploaded to the guest with copy/copy_in, was way too bigger than it was supposted to me b) the timing information is actually helpful to diagnose slow API calls (hello, vmware-uninstall-tools.pl)
An alternative might be to change them to make them shorter and/or less useless, but I'm not sure what that would be.
Unfortunately I don't have alternative solution, I'm afraid. The only bit that I never used was the proc number, since its name is way more helpful. -- Pino Toscano
participants (2)
-
Pino Toscano -
Richard W.M. Jones