From: Will Deacon <will.deacon@arm.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, vince@deater.net,
eranian@google.com, Arnaldo Carvalho de Melo <acme@infradead.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: Re: [PATCH 2/4] perf: Keep AUX flags in the output handle
Date: Tue, 21 Feb 2017 10:42:43 +0000 [thread overview]
Message-ID: <20170221104242.GB300@arm.com> (raw)
In-Reply-To: <20170220133352.17995-3-alexander.shishkin@linux.intel.com>
Hi Alexander,
Thanks for picking this up/adapting it. Just one comment below
On Mon, Feb 20, 2017 at 03:33:50PM +0200, Alexander Shishkin wrote:
> From: Will Deacon <will.deacon@arm.com>
>
> In preparation for adding more flags to perf AUX records, introduce a
> separate API for setting the flags for a session, rather than appending
> more bool arguments to perf_aux_output_end. This allows to set each
> flag at the time a corresponding condition is detected, instead of
> tracking it in each driver's private state.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> ---
--->8
> +void perf_aux_output_flag(struct perf_output_handle *handle, u64 flags)
> +{
> + /*
> + * OVERWRITE is determined by perf_aux_output_end() and can't
> + * be passed in directly.
> + */
> + if (WARN_ON_ONCE(flags & PERF_AUX_FLAG_OVERWRITE))
> + return;
Now that you've added this check...
> + handle->aux_flags |= flags;
> +}
> +EXPORT_SYMBOL_GPL(perf_aux_output_flag);
> +
> /*
> * This is called before hardware starts writing to the AUX area to
> * obtain an output handle and make sure there's room in the buffer.
> @@ -360,6 +373,7 @@ void *perf_aux_output_begin(struct perf_output_handle *handle,
> handle->event = event;
> handle->head = aux_head;
> handle->size = 0;
> + handle->aux_flags = 0;
>
> /*
> * In overwrite mode, AUX data stores do not depend on aux_tail,
> @@ -409,34 +423,32 @@ EXPORT_SYMBOL_GPL(perf_aux_output_begin);
> * of the AUX buffer management code is that after pmu::stop(), the AUX
> * transaction must be stopped and therefore drop the AUX reference count.
> */
> -void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size,
> - bool truncated)
> +void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size)
> {
> struct ring_buffer *rb = handle->rb;
> - bool wakeup = truncated;
> + bool wakeup = !!handle->aux_flags;
> unsigned long aux_head;
> - u64 flags = 0;
> -
> - if (truncated)
> - flags |= PERF_AUX_FLAG_TRUNCATED;
>
> /* in overwrite mode, driver provides aux_head via handle */
> if (rb->aux_overwrite) {
> - flags |= PERF_AUX_FLAG_OVERWRITE;
> + handle->aux_flags |= PERF_AUX_FLAG_OVERWRITE;
>
> aux_head = handle->head;
> local_set(&rb->aux_head, aux_head);
> } else {
> + handle->aux_flags &= ~PERF_AUX_FLAG_OVERWRITE;
> +
... I don't think you need this addition anymore. It's harmless, though.
Will
next prev parent reply other threads:[~2017-02-21 10:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 13:33 [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Alexander Shishkin
2017-02-20 13:33 ` [PATCH 1/4] perf: Export AUX buffer helpers to modules Alexander Shishkin
2017-02-20 13:33 ` [PATCH 2/4] perf: Keep AUX flags in the output handle Alexander Shishkin
2017-02-20 17:01 ` kbuild test robot
2017-02-20 17:17 ` Alexander Shishkin
2017-02-20 20:42 ` Mathieu Poirier
2017-02-21 10:42 ` Will Deacon [this message]
2017-02-21 10:54 ` Alexander Shishkin
2017-03-16 11:22 ` [tip:perf/core] perf/core: " tip-bot for Will Deacon
2017-02-20 13:33 ` [PATCH 3/4] perf: Add a flag for partial AUX records Alexander Shishkin
2017-03-16 11:23 ` [tip:perf/core] perf/core: " tip-bot for Alexander Shishkin
2017-03-16 14:24 ` Vince Weaver
2017-02-20 13:33 ` [PATCH 4/4] perf/x86/intel/pt: Handle VMX better Alexander Shishkin
2017-03-16 11:24 ` [tip:perf/core] " tip-bot for Alexander Shishkin
2017-02-20 15:18 ` [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Alexander Shishkin
2017-02-20 15:39 ` Adrian Hunter
2017-02-20 16:09 ` Arnaldo Carvalho de Melo
2017-02-20 16:31 ` Alexander Shishkin
2017-03-16 16:41 ` Alexander Shishkin
2017-03-21 6:50 ` [tip:perf/core] tools lib api fs: Introduce sysfs__read_bool tip-bot for Alexander Shishkin
2017-03-21 6:51 ` [tip:perf/core] tools include: Sync {,tools/}include/uapi/linux/perf_event.h tip-bot for Alexander Shishkin
2017-03-21 6:51 ` [tip:perf/core] perf tools: Handle partial AUX records and print a warning tip-bot for 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=20170221104242.GB300@arm.com \
--to=will.deacon@arm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=vince@deater.net \
/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