Akhil Jain writes:
> As soon as i restart my process all variables get deleted and now i need the 
> kernel stats from the time i started my process.But when using kstat it will 
> give me the stats from the time kernel has rebooted.So that's why i was 
> asking for such a mechanism to reset the kernel stats.So can we have any 
> workaround for such a scenario?

Read the kstat variables of interest as soon as your process starts,
and use that as the 'zero' reference point.  Subtract to get the delta
since program start.

We don't provide a way to reset the kstat values for at least three
reasons:

  1. It would be destructive.  Clearing out the kstats would affect
     *all* consumers, and not just the individual process or user
     currently reading them.

  2. It would violate SNMP semantics.  Counters are not permitted to
     roll backwards without an engine restart.

  3. Using simple arithmetic to arrive at interval deltas is simpler
     and more effective anyway, so there's just no need.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to