From: "J . A . Magallon" <jamagallon@able.es>
To: Lista Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: accounting for threads
Date: Thu, 14 Jun 2001 00:19:29 +0200 [thread overview]
Message-ID: <20010614001929.A1242@werewolf.able.es> (raw)
Hi.
First, sorry if this is a glibc issue. Just chose to ask here first.
I want to know the CPU time used by a POSIX-threaded program. I have tried
to use getrusage() with RUSAGE_SELF and RUSAGE_CHILDREN. Problem:
main thread just do nothing, spawns children and waits. And I get always
0 ru_utime.
I guess it can be because of 2 things:
- RUSAGE_CHILDREN only works for fork()'ed children (although in linux threads
and processes are the same). Perhaps fork() sets some kind of flag in
clone() for accounting.
- AFAIK, linux puts an intermediate 'thread controller'. That controller
uses no CPU time, and RUSAGE_CHILDREN gets only the first children level.
Any suggestion to mesaure threads CPU time ? I can't manage only with
wall-time, because I'm not sure to have all the box just for me.
And I would like also to mesaure system time to evaluate contention.
TIA
--
J.A. Magallon # Let the source be with you...
mailto:jamagallon@able.es
Linux Mandrake release 8.1 (Cooker) for i586
Linux werewolf 2.4.5-ac13 #1 SMP Sun Jun 10 21:42:28 CEST 2001 i686
next reply other threads:[~2001-06-13 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-13 22:19 J . A . Magallon [this message]
2001-06-19 14:53 accounting for threads Dan Kegel
2001-06-19 14:57 ` J . A . Magallon
2001-06-19 15:44 ` ognen
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=20010614001929.A1242@werewolf.able.es \
--to=jamagallon@able.es \
--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;
as well as URLs for NNTP newsgroup(s).