On Thu, May 13, 2010 at 11:52 PM, Tom Erickson
<thomas.erick...@oracle.com> wrote:
> Peter Tribble wrote:
>>
>> My plan to archive kstats using kstat -p output just got wrecked.
>> The snag is that for IO statistics (and I presume timer stats, but
>> they're pretty rare) the times are hrtime_t and kstat -p formats
>> the output in seconds as a floating number:
..
> Would it break anything if just 'kstat -p' always printed times in
> nanoseconds? If so, could you add an option to kstat that forces time values
> to be printed in nanoseconds?

I had a quick look at this and that doesn't look too easy. The snag is
that the perl module deep in its core takes the hrtime_t, divides it by
10^9 and converts it to a float. It's not just a display tweak.

So my next option is to quickly write something that largely emulates
kstat -p (with the kstat type added and the IO statistic times in the
underlying nanoseconds). This has the advantage that the tools I'm
using to read it don't need to be modified, and doing it in C is much
quicker that the perl implementation (so the measurement is less
likely to perturb the system).

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
_______________________________________________
observability-discuss mailing list
observability-discuss@opensolaris.org

Reply via email to