lkml.org 
[lkml]   [2012]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 02/16] perf: Add ability to attach registers dump to sample
    From
    Date
    On Wed, 2012-05-23 at 21:32 +0200, Jiri Olsa wrote:

    > --- a/include/linux/perf_event.h
    > +++ b/include/linux/perf_event.h
    > @@ -130,8 +130,9 @@ enum perf_event_sample_format {
    > PERF_SAMPLE_STREAM_ID = 1U << 9,
    > PERF_SAMPLE_RAW = 1U << 10,
    > PERF_SAMPLE_BRANCH_STACK = 1U << 11,
    > + PERF_SAMPLE_REGS = 1U << 12,
    >
    > - PERF_SAMPLE_MAX = 1U << 12, /* non-ABI */
    > + PERF_SAMPLE_MAX = 1U << 13, /* non-ABI */
    > };

    There's a comment update missing for PERF_RECORD_SAMPLE that describes
    the output this bit generates.

    > @@ -4011,6 +4042,30 @@ void perf_output_sample(struct perf_output_handle *handle,
    > perf_output_put(handle, nr);
    > }
    > }
    > +
    > + if (sample_type & PERF_SAMPLE_REGS) {
    > + u64 mode = event->attr.sample_regs;
    > +
    > + if (mode & PERF_SAMPLE_REGS_USER) {
    > + u64 id = PERF_REGS_ABI_NONE;
    > +
    > + /*
    > + * If there are no regs to dump, notice it through
    > + * PERF_REGS_ABI_NONE id.
    > + */
    > + if (data->regs_user)
    > + id = perf_reg_version();

    OK, so I don't like this.. why does this exists at all? Why not use a
    length field instead?

    > + perf_output_put(handle, id);
    > +
    > + if (id) {
    > + u64 mask = event->attr.sample_regs_user;
    > + perf_output_sample_regs(handle,
    > + data->regs_user,
    > + mask);
    > + }
    > + }
    > + }
    > }






    \
     
     \ /
      Last update: 2012-05-24 12:41    [W:4.471 / U:0.252 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site