Re: [PATCH 02/17] perf: Add ability to attach user level registersdump to sample

From: Stephane Eranian
Date: Thu Jul 26 2012 - 13:42:52 EST


On Wed, Jul 25, 2012 at 8:27 PM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> On Wed, Jul 25, 2012 at 07:39:18PM +0200, Stephane Eranian wrote:
>> On Sun, Jul 22, 2012 at 2:14 PM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>
> SNIP
>
>> > + if (sample_type & PERF_SAMPLE_REGS_USER) {
>> > + u64 avail = (data->regs_user != NULL);
>> > +
>> > + /*
>> > + * If there are no regs to dump, notice it through
>> > + * first u64 being zero.
>> > + */
>> > + perf_output_put(handle, avail);
>> > +
>> The only role of avail is to report whether or not you've captured actual
>> registers. Could it be used to report the sampled process ABI (32 vs. 64)
>> instead? Something like:
>> PERF_SAMPLE_REGS_ABI_NONE -> no regs captured (emulate your
>> current behavior)
>> PERF_SAMPLE_REGS_ABI_32 -> 32 bit ABI regs captured
>> PERF_SAMPLE_REGS_ABI_64 -> 64 bit ABI regs captured
>>
>> That could help the tools interpret the register values.
>
> Yes, I think that could help once we start dealing with compat tasks.
>
You don't control whether or not you capture compat tasks. So
you have to deal with those right now.

> The current userspace code stays untouched, because it checks for
> 'avail != 0', which stays even with your change.
>
> I think this could be sent later with all other fixes I'm already
> working on. But I can work/send it preferentially before whole patchset
> is taken if you like.
>
Well, why not do it now. You'd have to rename the available field
into something more sensible. Also need to prepare it for future
extension if they ever become necessary.
--
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/