From: Dan Kegel <dank@kegel.com>
To: "J . A . Magallon" <jamagallon@able.es>
Cc: Pete Wyckoff <pw@osc.edu>,
"linux-kernel @ vger . kernel . org"
<linux-kernel@vger.kernel.org>
Subject: Re: getrusage vs /proc/pid/stat?
Date: Tue, 19 Jun 2001 08:05:17 -0700 [thread overview]
Message-ID: <3B2F6A2D.A635747C@kegel.com> (raw)
In-Reply-To: <3B2D8ED0.40B299B5@kegel.com> <20010618134433.C9415@osc.edu> <3B2E7094.D53308BD@kegel.com> <20010619013406.A2531@werewolf.able.es>
"J . A . Magallon" wrote:
> I have just the same problem. getrusage() did not catch the CPU time for
> children, even if the man page said that. Now I am using times(2), that
> seems to work in Solaris, but gives nothing in Linux.
>
> I you look at time(1) manpage, it says time is implemented over the times(2)
> system call. But if I include that call, it gives me only zero.
>
> ????? time gives good results for summed CPU time, but my own call
> to times(2) fails ???
It could be that you have to wait() for the child before times()
includes it in 'children time'.
By the way, the source for time is easy to find. Here's debian's
(just search for time.c, then click on 'main'):
http://src.openresources.com/debian/src/utils/HTML/mains.html
If that doesn't help, maybe the code I sent you that reads /proc/pid/stat
for all threads of interest will. Either way, let me know...
- Dan
prev parent reply other threads:[~2001-06-19 15:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-18 5:17 getrusage vs /proc/pid/stat? Dan Kegel
2001-06-18 17:44 ` Pete Wyckoff
2001-06-18 21:20 ` Dan Kegel
2001-06-18 23:34 ` J . A . Magallon
2001-06-19 15:05 ` Dan Kegel [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=3B2F6A2D.A635747C@kegel.com \
--to=dank@kegel.com \
--cc=jamagallon@able.es \
--cc=linux-kernel@vger.kernel.org \
--cc=pw@osc.edu \
/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