Re: [PATCH v1 1/4] perf: Allow suppressing AUX records

From: Peter Zijlstra
Date: Wed Nov 15 2017 - 07:00:39 EST


On Tue, Nov 14, 2017 at 02:30:21PM +0200, Alexander Shishkin wrote:
> It has been pointed out to me many times that it is useful to be able
> to switch off AUX records to save the bandwidth for records that actually
> matter, for example, in AUX overwrite mode.
>
> The usefulness of PERF_RECORD_AUX is in some of its flags, like the
> TRUNCATED flag that tells the decoder where exactly gaps in the trace are.
> The OVERWRITE flag, on the other hand will be set on every single record
> in overwrite mode. However, a PERF_RECORD_AUX[flags=OVERWRITE] is
> generated on every target task's sched_out, which over time adds up to
> a lot of useless information.
>
> This patch adds an attribute bit that enables suppressing such records.

What this fails to explain is why a separate suppression flag makes
sense. Why not suppress the thing on overwrite mode and be done with it?

> + if (!handle->event->attr.suppress_aux ||
> + (handle->aux_flags & ~(u64)SUPPRESSABLE_FLAGS))
> + perf_event_aux_event(handle->event, aux_head, size,
> + handle->aux_flags);

That wants { }