All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Victor Jimenez <victor.javier@bsc.es>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: Problem when profiling a process' running/sleeping/waiting time
Date: Mon, 17 Jun 2013 17:20:03 +1000	[thread overview]
Message-ID: <1371453603.549.6.camel@concordia> (raw)
In-Reply-To: <50ED4CE0.7050201@bsc.es>

On Wed, 2013-01-09 at 11:56 +0100, Victor Jimenez wrote:
> I am trying to profile a process in terms of running, sleeping and 
> waiting time. I am using kernel 3.6.6 running on an IBM POWER7 machine. 
> Initially, I decided to use a toy example where I would expect that the 
> process remains in running state most of the time. This is the code for 
> such a simple example:
> 
> int main() {
>      for (int i = 0; i < 1000000; i++)
>          for (int j = 0; j < 1000; j++);
> }
> 
> I am using the following command line for reading kernel stats:
> 
> perf stat -e 
> "sched:sched_stat_runtime,sched:sched_stat_sleep,sched:sched_stat_wait, \
>      sched:sched_stat_iowait,sched:sched_stat_blocked" ./test
> 
> And these are the results that I obtain:
> 
>   Performance counter stats for './test':
> 
>      12,077,957,756 sched:sched_stat_runtime
>     169,892,740,990 sched:sched_stat_sleep
>           5,816,784 sched:sched_stat_wait
>                   0 sched:sched_stat_iowait
>                   0 sched:sched_stat_blocked
> 
>       12.084706279  seconds time elapsed
> 
> I cannot really understand why the counter for sched_stat_sleep is so 
> high (even higher than sched_stat_runtime), especially for such a 
> CPU-bound workload.
> 
> Am I missing anything, or there could be a problem with sched_stat_sleep 
> counter?

Hi Victor,

Did you ever work out what was going on here?

cheers

      reply	other threads:[~2013-06-17  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 10:56 Problem when profiling a process' running/sleeping/waiting time Victor Jimenez
2013-06-17  7:20 ` Michael Ellerman [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=1371453603.549.6.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=victor.javier@bsc.es \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.