2012/10/25 Peter (Stig) Edwards via RT <bug-Proc-ProcessTable@rt.cpan.org>:
Show quoted text> Thu Oct 25 10:19:58 2012: Request 80391 was acted upon.
> Transaction: Ticket created by thatsafunnyname
> Queue: Proc-ProcessTable
> Subject: Process::Process pctcpu does not include system CPU time
> Broken in: 0.46
> Severity: (no value)
> Owner: Nobody
> Requestors: thatsafunnyname@gmail.com
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=80391 >
>
>
> Hello and thank you for Proc-ProcessTable-0.46
>
> I noticed in Process::Process
>
> "pctcpu percent cpu used since process started"
>
> but in Os.c in the calc_prec function the percentage is only using the
> user CPU time and not the system CPU time.
>
> Changing:
>
> << float pctcpu = 100.0f * ( (prs->utime) / 1e6) / (time(NULL) - prs-
>>start_time);
>>> float pctcpu = 100.0f * ( (prs->utime + prs->stime) / 1e6) /
> (time(NULL) - prs->start_time);
>
> Fixes this. I am on linux kernel 2.6.18-308.11.1.el5.
>
> Cheers,
> Peter (Stig) Edwards
Hi Peter,
I can tell you only the same like I tell all others:
There're some prerequisites not fulfilled needed for proper
P::PT rewrite fixing all (or most) reported issues. Depending
on your requirements please check out libstatgrab (patched)
at
http://www.netbsd.org/~sno/smart-snmpd/
That code is widely tested and should be easy to integrate.
/Jens