Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-24 Thread Ingo Molnar
* Peter Zijlstra wrote: > I never can seem to figure out how to use the scripts mess :/ > acme, is there anything we could do to make that stuff usable? > There's a ton of crap under scripts/ but I don't even know how > to get that stuff to run. > > What's more, all that nonsense is in

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-24 Thread Ingo Molnar
* Peter Zijlstra a.p.zijls...@chello.nl wrote: I never can seem to figure out how to use the scripts mess :/ acme, is there anything we could do to make that stuff usable? There's a ton of crap under scripts/ but I don't even know how to get that stuff to run. What's more, all that

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
... NIH snipped ... > If you do this inside perf, you have access to more infrastructure > code, e.g., dwarf. > For instance, I am interested in getting a value profiling mode. That > means sampling > the values of function arguments. That needs some dwarf support and the PEBS > machine state.

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Stephane Eranian
On Tue, Oct 23, 2012 at 3:45 PM, Andi Kleen wrote: >> I believe we can use a similar approach to PERF_SAMPLE_REGS to expose >> the PEBS machine state. We need to add PERF_SAMPLE_IREGS and then >> return interrupt machine registers with regular sampling and the PEBS machine >> registers in precise

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
On Tue, Oct 23, 2012 at 03:50:50PM +0200, Peter Zijlstra wrote: > PERF_SAMPLE_RAW has a u32 size header and starts the data after that. > This means you PERF_SAMPLE_RAW output ends up on a u32 aligned end > address -- assuming the data is a u64 multiple, this is not good. > > > It appears to work

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Peter Zijlstra
On Tue, 2012-10-23 at 15:30 +0200, Andi Kleen wrote: > > Also, there's an alignment issue there, the raw.data is 32bit offset, > > the record is u64 aligned, leaving the output stream offset, wrecking > > things. > > Can you explain more? Not sure I understand. PERF_SAMPLE_RAW has a u32 size

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
> I believe we can use a similar approach to PERF_SAMPLE_REGS to expose > the PEBS machine state. We need to add PERF_SAMPLE_IREGS and then > return interrupt machine registers with regular sampling and the PEBS machine > registers in precise mode. A while back I wrote a patch to do just this.

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
> Also, there's an alignment issue there, the raw.data is 32bit offset, > the record is u64 aligned, leaving the output stream offset, wrecking > things. Can you explain more? Not sure I understand. It appears to work at least. > > And as with any ABI extension, it should come with useful

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Stephane Eranian
On Tue, Oct 23, 2012 at 2:31 PM, Peter Zijlstra wrote: > On Thu, 2012-10-18 at 16:19 -0700, Andi Kleen wrote: >> + if (event->attr.sample_type & PERF_SAMPLE_RAW) { >> + raw.size = x86_pmu.pebs_record_size; >> + raw.data = __pebs; >> + data.raw = >>

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Peter Zijlstra
On Thu, 2012-10-18 at 16:19 -0700, Andi Kleen wrote: > + if (event->attr.sample_type & PERF_SAMPLE_RAW) { > + raw.size = x86_pmu.pebs_record_size; > + raw.data = __pebs; > + data.raw = > + } The Changelog babbles about registers, yet you

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Peter Zijlstra
On Thu, 2012-10-18 at 16:19 -0700, Andi Kleen wrote: + if (event-attr.sample_type PERF_SAMPLE_RAW) { + raw.size = x86_pmu.pebs_record_size; + raw.data = __pebs; + data.raw = raw; + } The Changelog babbles about registers, yet you export

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Stephane Eranian
On Tue, Oct 23, 2012 at 2:31 PM, Peter Zijlstra a.p.zijls...@chello.nl wrote: On Thu, 2012-10-18 at 16:19 -0700, Andi Kleen wrote: + if (event-attr.sample_type PERF_SAMPLE_RAW) { + raw.size = x86_pmu.pebs_record_size; + raw.data = __pebs; +

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
Also, there's an alignment issue there, the raw.data is 32bit offset, the record is u64 aligned, leaving the output stream offset, wrecking things. Can you explain more? Not sure I understand. It appears to work at least. And as with any ABI extension, it should come with useful userspace

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
I believe we can use a similar approach to PERF_SAMPLE_REGS to expose the PEBS machine state. We need to add PERF_SAMPLE_IREGS and then return interrupt machine registers with regular sampling and the PEBS machine registers in precise mode. A while back I wrote a patch to do just this. Once

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Peter Zijlstra
On Tue, 2012-10-23 at 15:30 +0200, Andi Kleen wrote: Also, there's an alignment issue there, the raw.data is 32bit offset, the record is u64 aligned, leaving the output stream offset, wrecking things. Can you explain more? Not sure I understand. PERF_SAMPLE_RAW has a u32 size header and

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
On Tue, Oct 23, 2012 at 03:50:50PM +0200, Peter Zijlstra wrote: PERF_SAMPLE_RAW has a u32 size header and starts the data after that. This means you PERF_SAMPLE_RAW output ends up on a u32 aligned end address -- assuming the data is a u64 multiple, this is not good. It appears to work at

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Stephane Eranian
On Tue, Oct 23, 2012 at 3:45 PM, Andi Kleen a...@firstfloor.org wrote: I believe we can use a similar approach to PERF_SAMPLE_REGS to expose the PEBS machine state. We need to add PERF_SAMPLE_IREGS and then return interrupt machine registers with regular sampling and the PEBS machine registers

Re: [PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-23 Thread Andi Kleen
... NIH snipped ... If you do this inside perf, you have access to more infrastructure code, e.g., dwarf. For instance, I am interested in getting a value profiling mode. That means sampling the values of function arguments. That needs some dwarf support and the PEBS machine state. With

[PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-18 Thread Andi Kleen
From: Andi Kleen Add support for reporting PEBS records in a raw format that can be then parsed by perf script. We exposed most of the Haswell PEBS fields in a generic way in this patchkit: - Aborted cycles is in weight - Memory latency is in weight - DataLA is in address - EventingRIP is used

[PATCH 05/34] perf, x86: Report PEBS event in a raw format

2012-10-18 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com Add support for reporting PEBS records in a raw format that can be then parsed by perf script. We exposed most of the Haswell PEBS fields in a generic way in this patchkit: - Aborted cycles is in weight - Memory latency is in weight - DataLA is in address -