On 09/11/17 19:05, Alexander Shishkin wrote:
> diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
> index f684d8e5fa2b..d3f147e99165 100644
> --- a/kernel/events/ring_buffer.c
> +++ b/kernel/events/ring_buffer.c
> @@ -425,6 +425,12 @@ static bool __always_inline rb_need_aux_wakeup(struct 
> ring_buffer *rb)
>       return false;
>  }
>  
> +/*
> + * These flags won't generate a PERF_RECORD_AUX on their own if
> + * attr::suppress_aux is set.
> + */
> +#define SUPPRESSABLE_FLAGS   PERF_AUX_FLAG_OVERWRITE
> +
>  /*
>   * Commit the data written by hardware into the ring buffer by adjusting
>   * aux_head and posting a PERF_RECORD_AUX into the perf buffer. It is the
> @@ -459,8 +465,10 @@ void perf_aux_output_end(struct perf_output_handle 
> *handle, unsigned long size)
>                * Only send RECORD_AUX if we have something useful to 
> communicate
>                */
>  
> -             perf_event_aux_event(handle->event, aux_head, size,
> -                                  handle->aux_flags);
> +             if (handle->event->attr.suppress_aux &&
> +                 handle->aux_flags & ~SUPPRESSABLE_FLAGS)

Is that right?  I would have expected:

                if (!handle->event->attr.suppress_aux ||
                    handle->aux_flags & ~SUPPRESSABLE_FLAGS)

Also aux_flags is u64 but ~SUPPRESSABLE_FLAGS is int by default I think.

> +                     perf_event_aux_event(handle->event, aux_head, size,
> +                                          handle->aux_flags);
>       }
>  
>       rb->user_page->aux_head = rb->aux_head;
> 

Reply via email to