Re: [PATCH 2/2] hwclock: fix debug regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 November 2017 at 21:21, J William Piggott <elseifthen@xxxxxxx> wrote:
>
> commit f0a0ce7 makes debug mode implicit for the --test option.
>
> Using the previous command syntax of --test and --debug
> together invokes the undocumented Level 2 debugging when
> setting the RTC. This can cause many thousands of lines of
> output like:
> 1510967983.499968 < 1510967983.500000 (-0.000032)
>
> Fix: bump Level 2 debugging to Level 9, just before the
> other undocumented Level 10. This makes it improbable for
> the development debug levels to be accessed unintentionally.
>
> Signed-off-by: J William Piggott <elseifthen@xxxxxxx>
> ---
>  sys-utils/hwclock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
> index 8ff33474e..e5f90a44e 100644
> --- a/sys-utils/hwclock.c
> +++ b/sys-utils/hwclock.c
> @@ -494,7 +494,7 @@ set_hardware_clock_exact(const struct hwclock_control *ctl,
>                         /* The retarget is handled at the end of the loop. */
>                 } else if (deltavstarget < 0) {
>                         /* deltavstarget < 0 if current time < target time */
> -                       if (ctl->debug >= 2)
> +                       if (ctl->debug >= 9)
>                                 printf(_("%ld.%06ld < %ld.%06ld (%.6f)\n"),
>                                        nowsystime.tv_sec,
>                                        nowsystime.tv_usec,

That is probably fine as intermediate issue fix. It would be nice to
see in longer term move to use debug.h. Then ctl->debug could
be made single bit switch that turns on messaging it does, and
all internal developer debugging stuff would be done with
HWCLOCK_DEBUG_ bits. Assuming done this way adding more
debuging levels is appropriate.

FYI login-utils/su-common.c is pretty good DBG example.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux