Gavin Maltby wrote:
On 05/08/07 16:11, Garrett D'Amore wrote:
Gavin Maltby wrote:
On 05/03/07 20:04, Garrett D'Amore wrote:
If the device isn't in use, then probably the historical data
simply is not interesting.
They could be useful in post-mortem debugging where they represent
a small handle on past history relative to the snapshot-in-time
which the system crash dump represents.
Hmm... I think that's a pretty narrow "could". In the vast majority
of cases, drivers that have interesting kstats don't come and go very
often, and when they do, it is usually due to DR. Dynamic
Reconfiguration is such a massive impact on the system that I doubt
very much that data from _before_ the DR operation is likely to be
useful in debugging an event that occurred _after_ the DR, with the
possible exception of debugging the DR event itself. (But in that
case, generally the problem is with a device that refuses to detach,
and therefore won't have destroyed its stats!)
The commonly-useful case here is in cases where the DR operation itself
fails or produces a crash. You want all the recent history information
you can dig up. DR is notoriously difficult to debug precisely because
of lost information.
This sounds like an "edge" case to me. I.e. using kstats to attempt to
locate a kernel bug. (Kstats are unlikely to explain the "why" for a
failure-to-detach, or at least, they are for a driver that is detaching,
since the kstats of interest are probably still in the kernel at detach
time. (Generally clobbering freeing kstats is one of the last things a
driver does on the way out. Note that in the nemo case this isn't quite
precisely true... but there may be some adjustment we can do there.)
The second question I have is, where is this most useful? If it is only
for DEBUG kernels, I can imagine that we could create a DEBUG behavior
where kstat_delete() doesn't really delete the stat, but stat, but puts
it into some kind of historical archive. (Keeping the most recent, or N
most recent, stats from each driver.) This could facilitate debug,
without confusing _administrative_ use, and without interfering with
normal driver use. Further, this functionality could (should?) be made
independent of KSTAT_FLAG_PERSISTENT (or any other flag). And it
doesn't have to be DEBUG kernels only, it could be tunable via an
/etc/system value (historical_kstats = 1 in /etc/system?)
-- Garrett
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code