Linux Perf Users
 help / color / mirror / Atom feed
From: Milian Wolff <mail@milianw.de>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-perf-users <linux-perf-users@vger.kernel.org>
Subject: Re: Perf event for Wall-time based sampling?
Date: Thu, 18 Sep 2014 17:26:33 +0200	[thread overview]
Message-ID: <2297882.Vc1x1zOfA6@milian-kdab2> (raw)
In-Reply-To: <20140918145124.GF2770@kernel.org>

On Thursday 18 September 2014 11:51:24 Arnaldo Carvalho de Melo wrote:
> Em Thu, Sep 18, 2014 at 03:41:20PM +0200, Milian Wolff escreveu:
> > On Thursday 18 September 2014 10:23:50 Arnaldo Carvalho de Melo wrote:
> > > Em Thu, Sep 18, 2014 at 02:32:10PM +0200, Milian Wolff escreveu:
> > > > is it somehow possible to use perf based on some kernel timer? I'd
> > > > like to
> > > > get
> > > 
> > > Try with tracepoints or with probe points combined with callchains
> > > instead of using a hardware counter.
> > 
> > where would you add such tracepoints? Or what tracepoint would you use?
> > And
> > what is the difference between tracepoints and probe points (I'm only
> > aware of `perf probe`).
> 
> tracepoints are places in the kernel (and in userspace as well, came
> later tho) where developers put in place for later tracing.
> 
> They are super optimized, so have a lower cost than 'probe points' that
> you can put in place using 'perf probe'.
> 
> To see the tracepoints, or any other available event in your system, use
> 'perf list'.
> 
> The debugfs filesystem will need to be mounted, but that will be
> transparently done if the user has enough privileges.

Thanks for the quick rundown Arnaldo! Sadly, that much I "knew" already, yet 
am not able to understand how to use for my purpose.

> For instance, here are some tracepoints that you may want to use:
> 
> [root@zoo ~]# perf list sched:*

<snip>

I tried this:

# a.out is the result of compiling `int main { sleep(1); return 0; }`:
perf record -e sched:* --call-graph dwarf ./a.out
perf report -g graph --stdio
# the result can be found here: http://paste.kde.org/pflkskwrf

How do I have to interpret this?

a) This is not Wall-clock profiling, no? It just grabs a callgraph whenever 
one of the sched* events occurs, none of these events will occur, say, every X 
ms.
b) The callgraphs are really strange, imo. Different traces are printed with 
the same cost, which sounds wrong, no? See e.g. the multiple 44.44% traces in 
sched:sched_wakeup.
c) Most of the traces point into the kernel, how can I hide these traces and 
only concentrate on the user-space? Do I have to grep manually for [.] ? I 
tried something like `perf report --parent "main"` but that makes no 
difference.

> I would recommend that you take a look at Brendan Greggs _excellent_
> tutorials at:
> 
> http://www.brendangregg.com/perf.html
> 
> He will explain all this in way more detail than I briefly skimmed
> above. :-)

I did that already, but Brendan and the other available Perf documentation 
mostly concentrates on performance issues in the Kernel. I'm interested purely 
in the user space. Perf record with one of the hardware PMU events works 
nicely in that case, but one cannot use it to find locks&waits similar to what 
VTune offers.

Bye

-- 
Milian Wolff
mail@milianw.de
http://milianw.de

  reply	other threads:[~2014-09-18 15:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 12:32 Perf event for Wall-time based sampling? Milian Wolff
2014-09-18 13:23 ` Arnaldo Carvalho de Melo
2014-09-18 13:41   ` Milian Wolff
2014-09-18 14:51     ` Arnaldo Carvalho de Melo
2014-09-18 15:26       ` Milian Wolff [this message]
2014-09-18 15:57         ` Arnaldo Carvalho de Melo
2014-09-18 16:37           ` Milian Wolff
2014-09-18 19:17             ` Arnaldo Carvalho de Melo
2014-09-18 19:31               ` Arnaldo Carvalho de Melo
2014-09-18 20:17               ` David Ahern
2014-09-18 20:36                 ` Arnaldo Carvalho de Melo
2014-09-18 20:39                   ` David Ahern
2014-09-19  8:11                   ` Milian Wolff
2014-09-19  9:08                     ` Milian Wolff
2014-09-19 14:47                     ` Arnaldo Carvalho de Melo
2014-09-19 15:04                       ` David Ahern
2014-09-19 15:05                       ` Milian Wolff
2014-09-19 14:17                   ` David Ahern
2014-09-19 14:39                     ` Milian Wolff
2014-09-19 14:55                       ` David Ahern
2014-09-19  5:59               ` Namhyung Kim
2014-09-19 14:33                 ` Arnaldo Carvalho de Melo
2014-09-19 14:53                   ` Milian Wolff
2014-09-19 15:50                     ` Namhyung Kim
2014-09-22  7:56                 ` Namhyung Kim

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=2297882.Vc1x1zOfA6@milian-kdab2 \
    --to=mail@milianw.de \
    --cc=acme@kernel.org \
    --cc=linux-perf-users@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