Re: [PATCH V7 3/6] perf, x86: handle multiple records in PEBS buffer

From: Peter Zijlstra
Date: Tue May 05 2015 - 13:01:13 EST


On Tue, May 05, 2015 at 04:36:51PM +0000, Liang, Kan wrote:
> > > RECORDs are generic, and should live in the core code.
> > >
> > > Also, you should introduce this RECORD in a separate patch.
> >
> > On that, this is lacking a RECORD definition in
> > include/uapi/linux/perf_event.h:perf_event_type
>
> The PERF_RECORD_LOST already defined in perf_event_type.
> Are you suggesting to add a new dedicated RECORD type, like PERF_RECORD_COLLISION?

Yes, this should be a new RECORD, LOST_SAMPLES maybe.

The thing is, LOST is about the ring-buffer running out of space, this
is very much not the case here. Reusing it like this creates the
situation where userspace cannot tell what happened, and that is a very
bad thing indeed.

What we want to convey is that we dropped/lost a (number of) sample(s).

So the objection against the RECORD_COLLISIONS name is that it names the
reason we did something, but not the something we did.
--
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/