[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170823182648.nrzsbbsz2lwupaw4@hirez.programming.kicks-ass.net>
Date: Wed, 23 Aug 2017 20:26:48 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Liang, Kan" <kan.liang@...el.com>
Cc: "mingo@...hat.com" <mingo@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"acme@...nel.org" <acme@...nel.org>,
"jolsa@...hat.com" <jolsa@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"eranian@...gle.com" <eranian@...gle.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"mpe@...erman.id.au" <mpe@...erman.id.au>,
"maddy@...ux.vnet.ibm.com" <maddy@...ux.vnet.ibm.com>
Subject: Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR
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) {
Powered by blists - more mailing lists