On Thu, 2006-04-27 at 16:18, Thomas Maier-Komor wrote:
> Hi,
> 
> I'd like to add some more enhancements to my sysstat utlitiy,
> but I am stuck with libkstat's interface.
> 
> libkstat does not provide any mechanism to determine the
> maximum instance of a certain module.
...
> Is it possible to walk the datastructures of libkstat?

Just walk the kstat chain:

  char *module;
  int instance;
  char *name;
  char *class;
  kstat_ctl_t *kc;
  kstat_t *ks;
  kc = kstat_open();
  for (ks = kc->kc_chain; ks != 0; ks = ks->ks_next) {
    module = ks->ks_module;
    instance = ks->ks_instance;
    name = ks->ks_name;
    class = ks->ks_class;
  }

And pick up the matching kstats you want as you go.

-- 
-Peter Tribble
L.I.S., University of Hertfordshire - http://www.herts.ac.uk/
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/


_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to