Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 2018 11:55:52 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r329173 - head/sys/kern
Message-ID:  <1518461752.94819.42.camel@freebsd.org>
In-Reply-To: <201802121741.w1CHfBWa069971@repo.freebsd.org>
References:  <201802121741.w1CHfBWa069971@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2018-02-12 at 17:41 +0000, Ian Lepore wrote:
> Author: ian
> Date: Mon Feb 12 17:41:11 2018
> New Revision: 329173
> URL: https://svnweb.freebsd.org/changeset/base/329173
> 
> Log:
>   Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
>   read or write of all registered realtime clocks.  In the read case, the
>   values read are simply discarded.  For writes, there's no alternative but
>   to actually write the current system time to the device.
> 
> Modified:
>   head/sys/kern/subr_rtc.c

I've received several questions about this series of commits, which I
think means I probably should have put it up for review first.  I
didn't do so only because every other RTC-related change I've put on
phab has just languished without comments for a couple weeks before I
gave up waiting and committed it anyway.

As to what this series of rtc debugging changes was about in general...

I'm tired of hacking read-now/write-now sysctls into (and then back out
of before committing) every RTC driver I've ever worked on.  It's nice
to be able to debug them without actually changing the time on the
system continuously and/or rebooting.  If you can trigger the IO on
demand you can use kldload/unload while testing.  Otherwise the only
way to make a read happen after you've made a code change is to
reboot.  

Another motivation: I want to eliminate atrtc's ddb "show rtc" command
that only works in that one of the dozen+ rtc drivers we have, and it
brings complications to the atrtc code that I want to clean up.  

As to why I made clock_do_io a "write to read" thing...

I find myself always doing "sysctl -a | grep something" where something
is some fragment of an oid name I vaguely remember.  I'm probably not
alone in doing things like that, and I didn't want sysctl -a to start
triggering expensive hardware accesses like i2c bus transactions;
that's why I made it "write-to-read" (which requires that you go look
for the debugging output on the console or in dmesg, which is klunky,
but hey... this is debugging stuff, not some fancy new kernel abi for
reading time).

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1518461752.94819.42.camel>