Re: [PATCH 00/13] perf_events: add support for sampling takenbranches (v3)

From: Stephane Eranian
Date: Mon Jan 23 2012 - 12:14:16 EST


On Mon, Jan 23, 2012 at 1:25 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Mon, 2012-01-23 at 11:14 +0100, Stephane Eranian wrote:
>> Any comments on this patch set?
>>
> Queued it, thanks!

One thing that needs to happen with this branch sampling patch is that
Arnaldo needs
to apply the patch I developed with dsahern@ that changes the magic number to
something that can determine the endianess. I don't know what happened
to this patch.
It's been over 6 months since I posted it and it's still not in the
perf source tree.

The issue here is that with branch stack sampling, the size of
perf_event_attr has
now changed (an extra u64). As such if this new perf tries to read an
old perf.data
file, it is going to think it's using a different endianess, it'll
swap the attr_size and still
find it different from its own version of the struct. That leads to:
incompatible file
format.

We need to separate endianess detection from attr_size. If attr_size
in perf.data <
then sizeof(struct perf_event_attr), then just zero out the extra
(unused) fields.
With that in place, this new perf will be able to read older perf.data files.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/