mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"acme@kernel.org" <acme@kernel.org>,
	"jolsa@redhat.com" <jolsa@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"eranian@google.com" <eranian@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"mpe@ellerman.id.au" <mpe@ellerman.id.au>,
	"maddy@linux.vnet.ibm.com" <maddy@linux.vnet.ibm.com>
Subject: Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR
Date: Wed, 23 Aug 2017 20:26:48 +0200	[thread overview]
Message-ID: <20170823182648.nrzsbbsz2lwupaw4@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0775378AA5B@SHSMSX103.ccr.corp.intel.com>

On Wed, Aug 23, 2017 at 06:01:25PM +0000, Liang, Kan wrote:

> For x86, I think we can do something as below. But I'm not sure other architectures.

If you'd done: git grep PERF_SAMPLE_ADDR, you'd have found:

arch/powerpc/perf/core-book3s.c:                if (event->attr.sample_type & PERF_SAMPLE_ADDR)

Which suggests something rather similar..


> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index a322fed..9bf29dc 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -1175,7 +1175,7 @@ static void setup_pebs_sample_data(struct perf_event *event,
>         else
>                 regs->flags &= ~PERF_EFLAGS_EXACT;
> 
> -       if ((sample_type & PERF_SAMPLE_ADDR) &&
> +       if ((sample_type & (PERF_SAMPLE_ADDR | PERF_SAMPLE_PHYS_ADDR) &&
>             x86_pmu.intel_cap.pebs_format >= 1)
>                 data->addr = pebs->dla;

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 6c2d4168daec..c833fb26f0bb 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2039,7 +2039,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
 
 		perf_sample_data_init(&data, ~0ULL, event->hw.last_period);
 
-		if (event->attr.sample_type & PERF_SAMPLE_ADDR)
+		if (event->attr.sample_type & (PERF_SAMPLE_ADDR | PERF_SAMPLE_PHYS_ADDR))
 			perf_get_data_addr(regs, &data.addr);
 
 		if (event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK) {

  reply	other threads:[~2017-08-23 18:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 14:22 kan.liang
2017-08-23 14:33 ` Peter Zijlstra
2017-08-23 14:39   ` Peter Zijlstra
2017-08-23 17:00     ` Stephane Eranian
2017-08-31 16:44       ` Arnaldo Carvalho de Melo
2017-08-23 18:01     ` Liang, Kan
2017-08-23 18:26       ` Peter Zijlstra [this message]
2017-08-24  1:26   ` Michael Ellerman
2017-08-24  8:56     ` Peter Zijlstra
2017-08-24  9:52       ` Michael Ellerman

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=20170823182648.nrzsbbsz2lwupaw4@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®