afsd: print syscalls on separate lines with afsd -debug 85/12385/2
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 13 Sep 2016 02:21:59 +0000 (22:21 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 26 Dec 2016 18:14:58 +0000 (13:14 -0500)
afsd prints information to standard out for testing and debugging when the
-debug option is given. However, syscall tracing is emitted without trailing
newlines on all platforms except netbsd, creating an unreadable wall of text.

    # afsd -debug
    ...
    afsd: Forking 4 background daemons.
    SScall(183, 28, 0)=0 183, 28, 6583200)=0 SScall(183, 28, 6583
    200)=0 SScall(183, 28, 6583200)=0 SScall(183, 28, 6583200)=0 S
    Scall(183, 28, 6583200)=0 SScall(183, 28, 6583200)=0 SScall(18
    ...

Make the syscall call tracing usable by printing each one on a separate line.

    # afsd -deubg
    ...
    afsd: Forking 4 background daemons.
    SScall(183, 28, 0)=0 183, 28, 6583200)=0
    SScall(183, 28, 6583200)=0
    SScall(183, 28, 6583200)=0
    ...

Change-Id: Ic9208243c1e05352744fb6f575384e00d0e3e59c
Reviewed-on: https://gerrit.openafs.org/12385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afsd/afsd_kernel.c

index 5799f3d..cc4c02b 100644 (file)
@@ -279,7 +279,7 @@ afsd_call_syscall(struct afsd_syscall_args *args)
         printf("SScall(%d, %d, %d)=%d (%d, %s)\n", AFS_SYSCALL, AFSCALL_CALL,
                 (int)args->params[0], error, errno, s);
 #else
-       printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL,
+       printf("SScall(%d, %d, %d)=%d\n", AFS_SYSCALL, AFSCALL_CALL,
               (int)args->params[0], error);
 #endif
     }