From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Mike Leach <mike.leach@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org,
linux-doc@vger.kernel.org, suzuki.poulose@arm.com,
yabinc@google.com, corbet@lwn.net, leo.yan@linaro.org,
alexander.shishkin@linux.intel.com, tingwei@codeaurora.org,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 06/10] coresight: etm-perf: Update to activate selected configuration
Date: Thu, 1 Apr 2021 10:53:53 -0600 [thread overview]
Message-ID: <20210401165353.GB145043@xps15> (raw)
In-Reply-To: <20210316180400.7184-7-mike.leach@linaro.org>
On Tue, Mar 16, 2021 at 06:03:56PM +0000, Mike Leach wrote:
> Add calls to activate the selected configuration as perf starts
> and stops the tracing session.
>
> Signed-off-by: Mike Leach <mike.leach@linaro.org>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
> drivers/hwtracing/coresight/coresight-etm-perf.c | 14 +++++++++++++-
> drivers/hwtracing/coresight/coresight-etm-perf.h | 2 ++
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
> index 66bda452a2f4..9128f59864a8 100644
> --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> @@ -196,6 +196,10 @@ static void free_event_data(struct work_struct *work)
> /* Free the sink buffers, if there are any */
> free_sink_buffer(event_data);
>
> + /* clear any configuration we were using */
> + if (event_data->cfg_hash)
> + cscfg_deactivate_config(event_data->cfg_hash);
> +
> for_each_cpu(cpu, mask) {
> struct list_head **ppath;
>
> @@ -254,7 +258,7 @@ static void etm_free_aux(void *data)
> static void *etm_setup_aux(struct perf_event *event, void **pages,
> int nr_pages, bool overwrite)
> {
> - u32 id;
> + u32 id, cfg_hash;
> int cpu = event->cpu;
> cpumask_t *mask;
> struct coresight_device *sink = NULL;
> @@ -271,6 +275,14 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
> sink = coresight_get_sink_by_id(id);
> }
>
> + /* check if user wants a coresight configuration selected */
> + cfg_hash = (u32)((event->attr.config2 & GENMASK_ULL(63, 32)) >> 32);
> + if (cfg_hash) {
> + if (cscfg_activate_config(cfg_hash))
> + goto err;
> + event_data->cfg_hash = cfg_hash;
> + }
> +
> mask = &event_data->mask;
>
> /*
> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.h b/drivers/hwtracing/coresight/coresight-etm-perf.h
> index ba617fe2217e..468f7799ab4f 100644
> --- a/drivers/hwtracing/coresight/coresight-etm-perf.h
> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.h
> @@ -49,12 +49,14 @@ struct etm_filters {
> * @work: Handle to free allocated memory outside IRQ context.
> * @mask: Hold the CPU(s) this event was set for.
> * @snk_config: The sink configuration.
> + * @cfg_hash: The hash id of any coresight config selected.
> * @path: An array of path, each slot for one CPU.
> */
> struct etm_event_data {
> struct work_struct work;
> cpumask_t mask;
> void *snk_config;
> + u32 cfg_hash;
> struct list_head * __percpu *path;
> };
>
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-04-01 16:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 18:03 [PATCH v5 00/10] CoreSight configuration management; ETM strobing Mike Leach
2021-03-16 18:03 ` [PATCH v5 01/10] coresight: syscfg: Initial coresight system configuration Mike Leach
2021-03-16 22:52 ` kernel test robot
2021-03-29 19:54 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 02/10] coresight: syscfg: Add registration and feature loading for cs devices Mike Leach
2021-03-29 21:35 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 03/10] coresight: config: Add configuration and feature generic functions Mike Leach
2021-03-17 0:07 ` kernel test robot
2021-03-30 17:53 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 04/10] coresight: etm-perf: update to handle configuration selection Mike Leach
2021-03-17 1:16 ` kernel test robot
2021-03-31 20:48 ` Mathieu Poirier
2021-04-01 13:45 ` Mike Leach
2021-03-16 18:03 ` [PATCH v5 05/10] coresight: syscfg: Add API to activate and enable configurations Mike Leach
2021-04-01 16:43 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 06/10] coresight: etm-perf: Update to activate selected configuration Mike Leach
2021-04-01 16:53 ` Mathieu Poirier [this message]
2021-03-16 18:03 ` [PATCH v5 07/10] coresight: etm4x: Add complex configuration handlers to etmv4 Mike Leach
2021-04-01 17:10 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 08/10] coresight: config: Add preloaded configurations Mike Leach
2021-04-01 17:21 ` Mathieu Poirier
2021-03-16 18:03 ` [PATCH v5 09/10] coresight: syscfg: Add initial configfs support Mike Leach
2021-04-05 20:56 ` Mathieu Poirier
2021-04-06 11:08 ` Mike Leach
2021-03-16 18:04 ` [PATCH v5 10/10] coresight: docs: Add documentation for CoreSight config Mike Leach
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=20210401165353.GB145043@xps15 \
--to=mathieu.poirier@linaro.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=corbet@lwn.net \
--cc=coresight@lists.linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.com \
--cc=tingwei@codeaurora.org \
--cc=yabinc@google.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