[collectd] Rare code in process.c?

Florian Forster octo at verplant.org
Wed Sep 16 22:49:03 CEST 2009

Hi Andrés,

On Wed, Sep 16, 2009 at 05:15:20PM +0200, Andrés J. Díaz wrote:
> 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.

you're right, the (re-)allocation of the memory can probably be avoided
if the function is turned into one with the following prototype:
-- 8< --
 static int *ps_read_tasks (int pid,
     unsigned long *ret_num_proc,
     unsigned long *ret_num_lwp);
-- >8 --

> Has this function (ps_read_task) any other purpouse? (maybe in the
> future?).

Not that I'm aware of.

> P.S.: The good news: maybe in a couple of weeks we can publish a
> (minimal) collectd port to AIX :D

Great :) I've never worked with AIX myself, but after all I've heard it
I'm grateful about that ;)

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090916/c747b6ea/attachment.pgp 

More information about the collectd mailing list