All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <asharma@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-perf-users@vger.kernel.org, acme@ghostprotocols.net,
	mingo@elte.hu, Stephane Eranian <eranian@google.com>
Subject: Re: Profiling sleep times?
Date: Mon, 3 Oct 2011 14:53:09 -0700	[thread overview]
Message-ID: <4E8A2EC5.1030901@fb.com> (raw)
In-Reply-To: <1317673027.20367.41.camel@twins>

On 10/3/11 1:17 PM, Peter Zijlstra wrote:
> On Mon, 2011-10-03 at 12:38 -0700, Arun Sharma wrote:
>>                           trace_sched_stat_sleep(tsk, delta);
>
> That one should be accessible as a tracepoint and will add delay to
> count on each occurrence.

Right - the tracepoint seems to work. Was looking for the user stack 
trace as well. For eg:

# cat foo.c
#include <unistd.h>
#include <time.h>
#include <sys/select.h>

main()
{
         struct timespec ts1;
         struct timeval tv1;
         int i;


         for (i = 0; i < 1000; i++) {
                 ts1.tv_sec = 0;
                 ts1.tv_nsec = 1000000;
                 nanosleep(&ts1, NULL);

                 tv1.tv_sec = 0;
                 tv1.tv_usec = 4000;
                 select(0, NULL, NULL, NULL, &tv1);
         }
}

I want something that gives me 4 times as many samples on select() as 
nanosleep().

perf record -g -e sched:sched_stat_sleep -- ./foo

doesn't seem to do it. Additionally, if I have a burn_1us_cpu() loop in 
there, I'd expect to see as many samples as nanosleep() in the wall 
clock profile.

  -Arun

  reply	other threads:[~2011-10-03 21:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 19:38 Profiling sleep times? Arun Sharma
2011-10-03 20:17 ` Peter Zijlstra
2011-10-03 21:53   ` Arun Sharma [this message]
2011-10-04  8:34     ` Peter Zijlstra
2011-10-06 21:56       ` Arun Sharma
2011-10-07  0:05         ` Arun Sharma
2011-10-07  1:30         ` Peter Zijlstra
2011-10-07  5:42           ` avagin
2011-10-07  9:33             ` Peter Zijlstra
2011-10-07 17:58           ` Arun Sharma
2011-10-07 23:16             ` avagin
2011-10-08  1:45         ` avagin
2011-10-10 18:50           ` Arun Sharma
2011-10-12  7:41             ` Ingo Molnar
2011-10-13  5:39               ` Andrew Vagin
2011-10-14 21:19               ` Arun Sharma
2011-10-15 17:00                 ` Ingo Molnar
2011-10-15 19:22                   ` Peter Zijlstra
2011-10-15 19:29                     ` Peter Zijlstra
2011-10-18  1:07                       ` Arun Sharma
2011-10-22 10:49                         ` Frederic Weisbecker
2011-10-22 16:22                           ` Andrew Wagin
2011-10-23  0:27                           ` Arun Sharma

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=4E8A2EC5.1030901@fb.com \
    --to=asharma@fb.com \
    --cc=acme@ghostprotocols.net \
    --cc=eranian@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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 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.