public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: N Chandra Shekhar REDDY <ncs.reddy@st.com>
To: "'J.A. Magallon'" <jamagallon@able.es>
Cc: <linux-kernel@vger.kernel.org>
Subject: RE: Cpu utilization per thread
Date: Thu, 23 Jun 2005 11:48:31 +0530	[thread overview]
Message-ID: <083301c577bb$6264a580$99bcc68a@blr.st.com> (raw)
In-Reply-To: <1119403875l.7816l.1l@werewolf.able.es>

Thanks for the reply.
I have tried with getrusage it is giving zero as the result. 
I have found one more method(using setitimer(ITIMER_PROF,&enc_timer,NULL);
and signal SIGPROF) which will give the user and system time of a process. 
Is it applicable for the thread?
Does this method give the expected results for thread?
--ncs     


-----Original Message-----
From: J.A. Magallon [mailto:jamagallon@able.es] 
Sent: Wednesday, June 22, 2005 7:01 AM
To: N Chandra Shekhar REDDY
Cc: linux-kernel@vger.kernel.org
Subject: Re: Cpu utilization per thread



On 06.21, N Chandra Shekhar REDDY wrote:
> Hi all,
> Can any body tell me
> How to find cpu utilization per thread excluding wait times and sleep
times?
> Regards
> ncs
> 

man getrusage.

Pay special attention to the RUSAGE_SELF or RUSAGE_CHILDREN
flag, but I think current linux kernel does not perform a correct account
for threads rusage in the parent. Probably you will have to account each
thread, return info to the parent and sum or average (sum cpu times,
average elapsed times...)

--
J.A. Magallon <jamagallon()able!es>     \               Software is like
sex:
werewolf!able!es                         \         It's better when it's
free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.12-jam1 (gcc 4.0.1 (4.0.1-0.2mdk for Mandriva Linux release
2006.0))




  reply	other threads:[~2005-06-23  6:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21 12:50 Cpu utilization per thread N Chandra Shekhar REDDY
2005-06-22  1:31 ` J.A. Magallon
2005-06-23  6:18   ` N Chandra Shekhar REDDY [this message]
2005-06-22 17:41 ` Joe Seigh
  -- strict thread matches above, loose matches on Subject: below --
2005-06-21  6:31 N Chandra Shekhar REDDY
2005-06-21  5:29 CPU " N Chandra Shekhar REDDY

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='083301c577bb$6264a580$99bcc68a@blr.st.com' \
    --to=ncs.reddy@st.com \
    --cc=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