mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	David Ahern <dsahern@gmail.com>,
	linux-kernel@vger.kernel.org,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	yrl.pp-manager.tt@hitachi.com, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH -tip v5 2/5] perf: set correct value to perf_event_header.misc for BTS
Date: Tue, 21 Feb 2012 14:39:23 +0900	[thread overview]
Message-ID: <4F432E0B.5090608@hitachi.com> (raw)
In-Reply-To: <1327916138.2446.187.camel@twins>

(2012/01/30 18:35), Peter Zijlstra wrote:
> On Mon, 2012-01-30 at 13:43 +0900, Akihiro Nagai wrote:
>> @@ -330,6 +342,14 @@ int intel_pmu_drain_bts_buffer(void)
>>                  return 1;
>>
>>          for (; at<  top; at++) {
>> +               /*
>> +                * To resolve user space symbols and DSOs correctly, set
>> +                * PERF_RECORD_MISC_USER if from_addr or to_addr is user space.
>> +                */
>> +               if (!kernel_ip(data.ip) || !kernel_ip(data.addr)) {
>> +                       header.misc&= ~PERF_RECORD_MISC_CPUMODE_MASK;
>> +                       header.misc |= PERF_RECORD_MISC_USER;
>> +               }
>>                  data.ip         = at->from;
>>                  data.addr       = at->to;
>
> Why not key off of the from? If its a jump from userspace its a user
> event, its a jump from kernel space its a kernel event?

Of course, originally, perf does that. And, in those cases,
BTS records the both addresses of kernel and user in one
perf_sample on branches from kernel to user. Current perf
sets PERF_RECORD_MISC_KERNEL to all BTS events, and
perf-script doesn't resolve symbols and DSOs about the
user-space address, because it is a kernel event. So, to
solve both kernel and user symbols on an event, I had to
add this change.

Thank you,

  reply	other threads:[~2012-02-21  5:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  4:42 [PATCH -tip v5 0/5] perf script: add BTS analysis features Akihiro Nagai
2012-01-30  4:42 ` [PATCH -tip v5 1/5] perf-script: unify the expressions indicate "unknown" Akihiro Nagai
2012-01-31 13:17   ` [tip:perf/core] perf script: Unify the expressions indicating " unknown" tip-bot for Akihiro Nagai
2012-01-30  4:43 ` [PATCH -tip v5 2/5] perf: set correct value to perf_event_header.misc for BTS Akihiro Nagai
2012-01-30  9:35   ` Peter Zijlstra
2012-02-21  5:39     ` Akihiro Nagai [this message]
2012-03-06 17:32       ` Peter Zijlstra
2012-03-16  2:22         ` Akihiro Nagai
2012-01-30  4:43 ` [PATCH -tip v5 3/5] perf script: print branch_from and branch_to of BTS events Akihiro Nagai
2012-01-31 13:18   ` [tip:perf/core] perf script: Print " tip-bot for Akihiro Nagai
2012-01-30  4:43 ` [PATCH -tip v5 4/5] perf script: add the offset field specifier Akihiro Nagai
2012-01-31 13:19   ` [tip:perf/core] perf script: Add " tip-bot for Akihiro Nagai
2012-01-30  4:43 ` [PATCH -tip v5 5/5] perf script: add option resolving vmlinux path Akihiro Nagai
2012-01-31 13:20   ` [tip:perf/core] perf script: Add " tip-bot for Akihiro Nagai

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=4F432E0B.5090608@hitachi.com \
    --to=akihiro.nagai.hw@hitachi.com \
    --cc=acme@infradead.org \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=yrl.pp-manager.tt@hitachi.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

Powered by JetHome