Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-31 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 23, 2017 at 10:00:37AM -0700, Stephane Eranian escreveu: > On Wed, Aug 23, 2017 at 7:39 AM, Peter Zijlstra wrote: > > On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > >> > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header >

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-31 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 23, 2017 at 10:00:37AM -0700, Stephane Eranian escreveu: > On Wed, Aug 23, 2017 at 7:39 AM, Peter Zijlstra wrote: > > On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > >> > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header > >> > *header, > >> >

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-24 Thread Michael Ellerman
Peter Zijlstra writes: > On Thu, Aug 24, 2017 at 11:26:17AM +1000, Michael Ellerman wrote: >> Peter Zijlstra writes: >> >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> >> index d704e23..b991af3 100644 >> >> --- a/kernel/events/core.c >>

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-24 Thread Michael Ellerman
Peter Zijlstra writes: > On Thu, Aug 24, 2017 at 11:26:17AM +1000, Michael Ellerman wrote: >> Peter Zijlstra writes: >> >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> >> index d704e23..b991af3 100644 >> >> --- a/kernel/events/core.c >> >> +++ b/kernel/events/core.c >> >> @@

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-24 Thread Peter Zijlstra
On Thu, Aug 24, 2017 at 11:26:17AM +1000, Michael Ellerman wrote: > Peter Zijlstra writes: > >> diff --git a/kernel/events/core.c b/kernel/events/core.c > >> index d704e23..b991af3 100644 > >> --- a/kernel/events/core.c > >> +++ b/kernel/events/core.c > >> @@ -6027,6

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-24 Thread Peter Zijlstra
On Thu, Aug 24, 2017 at 11:26:17AM +1000, Michael Ellerman wrote: > Peter Zijlstra writes: > >> diff --git a/kernel/events/core.c b/kernel/events/core.c > >> index d704e23..b991af3 100644 > >> --- a/kernel/events/core.c > >> +++ b/kernel/events/core.c > >> @@ -6027,6 +6033,38 @@ void

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Michael Ellerman
Peter Zijlstra writes: >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> index d704e23..b991af3 100644 >> --- a/kernel/events/core.c >> +++ b/kernel/events/core.c >> @@ -6027,6 +6033,38 @@ void perf_output_sample(struct perf_output_handle >> *handle, >> }

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Michael Ellerman
Peter Zijlstra writes: >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> index d704e23..b991af3 100644 >> --- a/kernel/events/core.c >> +++ b/kernel/events/core.c >> @@ -6027,6 +6033,38 @@ void perf_output_sample(struct perf_output_handle >> *handle, >> } >> } >> >> +static

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 06:01:25PM +, 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 &

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 06:01:25PM +, 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 &

RE: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Liang, Kan
> On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > > > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct > > > perf_event_header *header, > > > > > > header->size += size; > > > } > > > + > > > + if (sample_type & PERF_SAMPLE_PHYS_ADDR) > > > +

RE: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Liang, Kan
> On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > > > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct > > > perf_event_header *header, > > > > > > header->size += size; > > > } > > > + > > > + if (sample_type & PERF_SAMPLE_PHYS_ADDR) > > > +

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Stephane Eranian
On Wed, Aug 23, 2017 at 7:39 AM, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: >> > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header >> > *header, >> > >> > header->size += size; >> > } >> > +

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Stephane Eranian
On Wed, Aug 23, 2017 at 7:39 AM, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: >> > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header >> > *header, >> > >> > header->size += size; >> > } >> > + >> > + if

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header > > *header, > > > > header->size += size; > > } > > + > > + if (sample_type & PERF_SAMPLE_PHYS_ADDR) > > + data->phys_addr =

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header > > *header, > > > > header->size += size; > > } > > + > > + if (sample_type & PERF_SAMPLE_PHYS_ADDR) > > + data->phys_addr =

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
Michael, Maddy, Since PPC implements PERF_SAMPLE_ADDR this affects you guys too, please have a look. On Wed, Aug 23, 2017 at 10:22:46AM -0400, kan.li...@intel.com wrote: > From: Kan Liang > > For understanding how the workload maps to memory channels and hardware >

Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread Peter Zijlstra
Michael, Maddy, Since PPC implements PERF_SAMPLE_ADDR this affects you guys too, please have a look. On Wed, Aug 23, 2017 at 10:22:46AM -0400, kan.li...@intel.com wrote: > From: Kan Liang > > For understanding how the workload maps to memory channels and hardware > behavior, it's very

[PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread kan . liang
From: Kan Liang For understanding how the workload maps to memory channels and hardware behavior, it's very important to collect address maps with physical addresses. For example, 3D XPoint access can only be found by filtering the physical address. However, perf doesn't

[PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR

2017-08-23 Thread kan . liang
From: Kan Liang For understanding how the workload maps to memory channels and hardware behavior, it's very important to collect address maps with physical addresses. For example, 3D XPoint access can only be found by filtering the physical address. However, perf doesn't collect physical address