CEPH filesystem development
 help / color / mirror / Atom feed
From: Mark Nelson <mark.nelson@inktank.com>
To: Milosz Tanski <milosz@adfin.com>, Mark Nelson <mark.nelson@inktank.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: Profiling with Perf
Date: Wed, 12 Nov 2014 15:16:15 -0600	[thread overview]
Message-ID: <5463CE1F.5060509@redhat.com> (raw)
In-Reply-To: <CANP1eJFi3AhK-7HYLm7n78=ygGK2d4_UXc2_EqOCc3tFUVvtOA@mail.gmail.com>

On 11/12/2014 02:59 PM, Milosz Tanski wrote:
> On Wed, Nov 12, 2014 at 3:42 PM, Mark Nelson <mark.nelson@inktank.com> wrote:
>> Hi, there was a question on the performance call today about how to use
>> dwarf symbols in perf.  Roughly:
>>
>> 1) Make sure during the kernel/perf compile that libunwind is used. This can
>> be tricky depending on how you build the kernel, but theoretically should
>> work.
>>
>> 2) invoke perf using something like:
>>
>> "perf record -g dwarf -F 100 -a"
>>
>> This tells perf to use dwarf symbols but limit the sampling rate.  perf can
>> generate a *lot* of data with dwarf symbols and default sampling.
>>
>> 3) Look at results in perf report as normal.
>>
>> 4) Profit!
>>
>> Theoretically if you have frame pointers enabled when you compile ceph you
>> should get good symbol resolution without dwarf but I've never gotten it to
>> work well.  Perf+Dwarf seems to give much better symbol resolution than
>> anything else I've tried with Ceph.  There's some new LBR functionality for
>> profiling on Haswell in perf that might work too, but I haven't tried it:
>>
>> https://lkml.org/lkml/2014/10/19/166
>
> Mark,
>
> I personally would strong recommend using perf without the dwarf as it
> seams writes very large trace files. It's not just file size, but it
> also takes a very long time to load up profile in the other tools
> (perf report). If you can help it rebuild the app with out the code
> (eg the gcc -fno-omit-frame-pointer flag). When I say space savings
> with call stack savings I mean like order of 2 magnitudes smaller
> profile file (eg. you can log much longer / complicated runs).

Do you have problems with large trace files when you limit the sampling 
frequency?  It hasn't been a problem for me when doing that.

>
> Additionally, it seams to better handle splitting of inline functions
> (where otherwise this would get folded into a large function). The
> omit behavior is default on x86_64, which is what I assume most people
> are building / testing on. There is a performance penalty for this as
> the compiler will be generating an extra instruction to update EBP...
> but for real world code this is less then 5% of a penalty.

To be honest even when compiling with fno-omit-frame-pointer I've had a 
ton of problems with symbol resolution.  It's been a while since I 
messed with this so perhaps things have improved since then.

>
> I spend a lot of time using perf and looking at it's traces (runtime,
> futex profiling, looking at bad branch points) every week. It took me
> a little while to figure this out... I hope it help you guys.

Other than compiling with fno-omit-frame-pointer, is there anything else 
you do to get good symbol resolution?  What platform are you using? 
This kind of information would be very valuable for the community if you 
can share. :)

>
> - Milosz
>
>>
>> Mark
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>


  reply	other threads:[~2014-11-12 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  2:22 Reminder: 11/12/2014 Weekly Ceph Performance Meeting Mark Nelson
2014-11-12 20:42 ` Profiling with Perf Mark Nelson
2014-11-12 20:59   ` Milosz Tanski
2014-11-12 21:16     ` Mark Nelson [this message]
2014-11-13  7:04       ` Alexandre DERUMIER
2014-11-14 21:38         ` Milosz Tanski
2014-11-14 21:33       ` Milosz Tanski

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=5463CE1F.5060509@redhat.com \
    --to=mark.nelson@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=milosz@adfin.com \
    /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