lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e099adc3-2c29-3830-a486-b0706c47942e@intel.com>
Date:   Fri, 10 Nov 2017 10:22:41 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Arnaldo Carvalho de Melo <acme@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
        Will Deacon <will.deacon@....com>,
        Markus Metzger <markus.t.metzger@...el.com>
Subject: Re: [PATCH 1/4] perf: Allow suppressing AUX records

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;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ