From: Adrian Hunter <adrian.hunter@intel.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
Markus Metzger <markus.t.metzger@intel.com>
Subject: Re: [PATCH 1/4] perf: Allow suppressing AUX records
Date: Fri, 10 Nov 2017 10:22:41 +0200 [thread overview]
Message-ID: <e099adc3-2c29-3830-a486-b0706c47942e@intel.com> (raw)
In-Reply-To: <20171109170548.32133-2-alexander.shishkin@linux.intel.com>
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;
>
next prev parent reply other threads:[~2017-11-10 8:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 17:05 [PATCH 0/4] perf: Allow suppressing useless " Alexander Shishkin
2017-11-09 17:05 ` [PATCH 1/4] perf: Allow suppressing " Alexander Shishkin
2017-11-10 8:22 ` Adrian Hunter [this message]
2017-11-09 17:05 ` [PATCH 2/4] tools, perf_event.h: Synchronize Alexander Shishkin
2017-11-09 17:05 ` [PATCH 3/4] perf tools: Add 'suppress_aux' attribute bit definition and fallback Alexander Shishkin
2017-11-09 17:05 ` [PATCH 4/4] perf intel-pt, intel-bts: Suppress useless AUX records by default Alexander Shishkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e099adc3-2c29-3830-a486-b0706c47942e@intel.com \
--to=adrian.hunter@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.t.metzger@intel.com \
--cc=mingo@redhat.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®