From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbdKJIW4 (ORCPT ); Fri, 10 Nov 2017 03:22:56 -0500 Received: from mga02.intel.com ([134.134.136.20]:49079 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbdKJIWz (ORCPT ); Fri, 10 Nov 2017 03:22:55 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,373,1505804400"; d="scan'208";a="483447" Subject: Re: [PATCH 1/4] perf: Allow suppressing AUX records To: Alexander Shishkin , Peter Zijlstra , Arnaldo Carvalho de Melo Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Will Deacon , Markus Metzger References: <20171109170548.32133-1-alexander.shishkin@linux.intel.com> <20171109170548.32133-2-alexander.shishkin@linux.intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Fri, 10 Nov 2017 10:22:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171109170548.32133-2-alexander.shishkin@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; >