[collectd] (maybe silly) Question about get_kstat

Marco Chiappero marco at absence.it
Thu Mar 19 11:52:12 CET 2009


Florian Forster ha scritto:
> Hi Marco,

Hi Florian,

> Checking the KSTAT_TYPE_NAMED twice (three times if you count the
> assertion) is of course not necessary. I suspect a copy'n'paste error ;)

Me too. Please remove the second one at least, kstat_read do not change 
ks_type.

> A quick `grep' revealed that `get_kstat' is only used in two places, the
> memory and the swap plugin - both trying to figure out the pagesize. If
> you need something else than `KSTAT_TYPE_NAMED', I'd suggest to move the
> checks to a new function `get_kstat_pagesize' and use that function in
> the two plugins.

I went for the kstat.h only solution.
Ok, I'm attaching the code, please check the preprocessor directives for 
the includes section, I don't much about defines created by the build 
system and its names.
I'm using it right now on a linux machine, but I haven't tested yet on 
Solaris and BSDs. Today I tried to compile it on OpenSolaris, but after 
fighting with the packaging system and many other things I gave up and 
decided I won't try anymore. So, since I'd like to say the plugin is 
done after testing it, Solaris testers are wanted :P
As soon as I can I will edit the wiki page, but first I want to have a 
closer look to the iptable plugin and see how many modifications are 
needed for IPv6 and then have an opinion about the single vs. double 
plugin approach.
See you soon :)

Regars,
Marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: types-uptime.db.patch
Type: text/x-patch
Size: 429 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090319/3587d2df/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uptime.c
Type: text/x-csrc
Size: 5059 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090319/3587d2df/attachment-0001.c 


More information about the collectd mailing list