lkml.org 
[lkml]   [2006]   [Jun]   [21]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 21 Jun 2006 08:58:32 +0200
From"Alex Riesen" <>
SubjectRe: Getting CPU Usage of a running child process
On 3/2/06, Arijit Das <Arijit.Das@synopsys.com> wrote:
> The times() function gets me the system/user CPU usage of me (invoking
> process) and all my terminated/waited children.
>
> Is there any User Space API/way for me (a process) to get the
> system/user CPU usage of one of my currently running child process? Am
> looking for a portable solution...not sure if there is any

There is a way to get the times for all children:
getrusage(RUSAGE_CHILDREN, &usage);
You can double-fork to get the info for a specific subprocess.
/proc is, as you probably noticed, not portable.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-21 07:01    [W:0.285 / U:0.000 seconds]
©2003-2008 Jasper Spaans