From: Andi Kleen <andi@firstfloor.org>
To: Milian Wolff <milian.wolff@kdab.com>
Cc: Andi Kleen <andi@firstfloor.org>, linux-perf-users@vger.kernel.org
Subject: Re: LBR unwinding for user defined dynamic trace point
Date: Thu, 7 Apr 2016 08:55:22 -0700 [thread overview]
Message-ID: <20160407155522.GE9407@two.firstfloor.org> (raw)
In-Reply-To: <2173915.EElRzu5JW2@milian-kdab2>
> Could you tell me what would be required to get LBR callgraphs supported for
> trace points? I noticed that it also does not work with static tracepoints or
> software events:
The perf trace point handler code would need to know how to read the LBR
registers and dump them into the trace stream. Right now that's only
implemented for the PMU overflow code. In principle it is not very
complicated, see
arch/x86/kernel/cpu/perf_event_intel_lbr.c:intel_pmu_lbr_read()
Basically would need to call that, but save the information
somewhere else (not the cpuc), and then dump it into the trace buffer.
For kernel LBRs it would also need to stop/restart them to avoid
pollution, but for the case you're likely interested in (LBR with ring 3
filter for user programs), that's not needed.
> Due to the reasons and advantages you point out in your article for LBR
> callgraphs, I'd love to see it supported for the above use-cases as well, if
> possible. If you can guide me, and it does not require me to patch the kernel
> itself, then I'm also willing to come up with a patch for perf.
It requires patching the kernel.
-Andi
prev parent reply other threads:[~2016-04-07 15:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-15 13:12 LBR unwinding for user defined dynamic trace point Milian Wolff
2015-09-15 14:02 ` Andi Kleen
2015-09-16 9:55 ` Milian Wolff
2015-09-16 18:56 ` Andi Kleen
2016-04-07 15:05 ` Milian Wolff
2016-04-07 15:55 ` Andi Kleen [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=20160407155522.GE9407@two.firstfloor.org \
--to=andi@firstfloor.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.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;
as well as URLs for NNTP newsgroup(s).