[collectd] Rare code in process.c?
Andrés J. Díaz
ajdiaz at connectical.com
Wed Sep 16 17:15:20 CEST 2009
Hi everyone!
I and my colleage Manuel were working on collectd code today and found
a rare code in proccess.c module:
We readed the ps_read_taks [1], this function read the contents of
directory /proc/<pid>/task and return a dynamic array with all pids
which are threads.
This function is called from ps_read_process but it's used only to
count these pids, then free the array. Has this function
(ps_read_task) any other purpouse? (maybe in the future?).
It's a heavy code due to realloc, and it's easy to count threads and
return the counter instead of the array (and faster too).
Has this function any sense for you?
Regards,
Andres
P.S.: The good news: maybe in a couple of weeks we can publish a
(minimal) collectd port to AIX :D
More information about the collectd
mailing list