mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alex Riesen" <raa.lkml@gmail.com>
To: "Arijit Das" <Arijit.Das@synopsys.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Getting CPU Usage of a running child process
Date: Wed, 21 Jun 2006 08:58:32 +0200	[thread overview]
Message-ID: <81b0412b0606202358l4148be0as54cf2c0e3da93f7f@mail.gmail.com> (raw)
In-Reply-To: <7EC22963812B4F40AE780CF2F140AFE9596587@IN01WEMBX1.internal.synopsys.com>

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.

      parent reply	other threads:[~2006-06-21  6:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AcY92pPSyN42OXgfQIad3rhpQJCOmw==>
2006-03-02  9:20 ` Arijit Das
2006-03-02 12:46   ` Prosenjit Kundu
2006-06-21  6:58   ` Alex Riesen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81b0412b0606202358l4148be0as54cf2c0e3da93f7f@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=Arijit.Das@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®