From: Mike Leach <mike.leach@linaro.org>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: "Suzuki K. Poulose" <suzuki.poulose@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Yabin Cui <yabinc@google.com>,
Coresight ML <coresight@lists.linaro.org>,
Jonathan Corbet <corbet@lwn.net>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Tingwei Zhang <tingwei@codeaurora.org>,
Leo Yan <leo.yan@linaro.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 06/10] coresight: etm-perf: Update to activate selected configuration
Date: Fri, 26 Feb 2021 20:09:57 +0000 [thread overview]
Message-ID: <CAJ9a7Vi5Dyb2k7uDxqRg99e-cxKyLkCgimMD8ZSO2m+1NdbFjg@mail.gmail.com> (raw)
In-Reply-To: <20210225215122.GC3567106@xps15>
Hi Mathieu,
On Thu, 25 Feb 2021 at 21:51, Mathieu Poirier
<mathieu.poirier@linaro.org> wrote:
>
> On Thu, Jan 28, 2021 at 05:09:32PM +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>
> > ---
> > 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 e270bb1e0f7d..5c1aeddabc59 100644
> > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> > @@ -178,6 +178,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->config_id_hash)
> > + cscfg_deactivate_config(event_data->config_id_hash);
> > +
> > for_each_cpu(cpu, mask) {
> > struct list_head **ppath;
> >
> > @@ -236,7 +240,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, config_id;
>
> config_id, cfg_hash, id_hash...
>
OK - I'll get the naming consistent.
> > int cpu = event->cpu;
> > cpumask_t *mask;
> > struct coresight_device *sink = NULL;
> > @@ -253,6 +257,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 */
> > + config_id = (u32)((event->attr.config2 & GENMASK_ULL(63, 32)) >> 32);
> > + if (config_id) {
> > + if (cscfg_activate_config(config_id))
> > + goto err;
> > + event_data->config_id_hash = config_id;
> > + }
> > +
> > mask = &event_data->mask;
> >
> > /*
> > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.h b/drivers/hwtracing/coresight/coresight-etm-perf.h
> > index 3646a3837a0b..751d768939d8 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.
> > + * @config_id_hash: The 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 config_id_hash;
>
> Please align this with the naming convention you will be using above and
> throughout.
>
> More comments tomorrow.
>
> Thanks,
> Mathieu
>
> > struct list_head * __percpu *path;
> > };
> >
> > --
> > 2.17.1
> >
Thanks
Mike
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
_______________________________________________
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-02-26 20:11 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 17:09 [PATCH v4 00/10] CoreSight configuration management; ETM strobing Mike Leach
2021-01-28 17:09 ` [PATCH v4 01/10] coresight: syscfg: Initial coresight system configuration Mike Leach
2021-02-18 23:52 ` Mathieu Poirier
2021-02-26 19:09 ` Mike Leach
2021-02-22 18:50 ` Mathieu Poirier
2021-02-26 19:10 ` Mike Leach
2021-03-03 10:09 ` Suzuki K Poulose
2021-03-03 15:12 ` Mike Leach
2021-03-03 10:23 ` Suzuki K Poulose
2021-03-04 10:08 ` Suzuki K Poulose
2021-03-04 10:47 ` Mike Leach
2021-03-04 10:48 ` Suzuki K Poulose
2021-01-28 17:09 ` [PATCH v4 02/10] coresight: syscfg: Add registration and feature loading for cs devices Mike Leach
2021-02-19 18:43 ` Mathieu Poirier
2021-02-26 19:14 ` Mike Leach
2021-02-27 20:52 ` Mathieu Poirier
2021-02-22 17:37 ` Mathieu Poirier
2021-02-26 19:16 ` Mike Leach
2021-02-22 19:05 ` Mathieu Poirier
2021-03-04 10:33 ` Suzuki K Poulose
2021-03-16 18:00 ` Mike Leach
2021-01-28 17:09 ` [PATCH v4 03/10] coresight: config: Add configuration and feature generic functions Mike Leach
2021-02-22 22:57 ` Mathieu Poirier
2021-03-04 11:25 ` Suzuki K Poulose
2021-01-28 17:09 ` [PATCH v4 04/10] coresight: etm-perf: update to handle configuration selection Mike Leach
2021-02-24 18:33 ` Mathieu Poirier
2021-02-26 19:26 ` Mike Leach
2021-03-04 12:13 ` Suzuki K Poulose
2021-03-04 14:19 ` Mike Leach
2021-03-04 14:25 ` Suzuki K Poulose
2021-03-04 14:46 ` Mike Leach
2021-01-28 17:09 ` [PATCH v4 05/10] coresight: syscfg: Add API to activate and enable configurations Mike Leach
2021-02-25 21:20 ` Mathieu Poirier
2021-02-25 21:46 ` Mathieu Poirier
2021-02-26 20:08 ` Mike Leach
2021-03-04 16:49 ` Suzuki K Poulose
2021-03-04 18:15 ` Mike Leach
2021-01-28 17:09 ` [PATCH v4 06/10] coresight: etm-perf: Update to activate selected configuration Mike Leach
2021-02-25 21:51 ` Mathieu Poirier
2021-02-26 20:09 ` Mike Leach [this message]
2021-03-04 16:50 ` Suzuki K Poulose
2021-01-28 17:09 ` [PATCH v4 07/10] coresight: etm4x: Add complex configuration handlers to etmv4 Mike Leach
2021-02-28 23:19 ` Mathieu Poirier
2021-03-05 10:18 ` Suzuki K Poulose
2021-03-17 15:04 ` Mike Leach
2021-01-28 17:09 ` [PATCH v4 08/10] coresight: config: Add preloaded configurations Mike Leach
2021-02-28 23:25 ` Mathieu Poirier
2021-03-05 13:39 ` Suzuki K Poulose
2021-01-28 17:09 ` [PATCH v4 09/10] coresight: syscfg: Add initial configfs support Mike Leach
2021-03-01 0:02 ` Mathieu Poirier
2021-03-01 0:04 ` Mathieu Poirier
2021-01-28 17:09 ` [PATCH v4 10/10] coresight: docs: Add documentation for CoreSight config Mike Leach
2021-02-18 21:28 ` Mathieu Poirier
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=CAJ9a7Vi5Dyb2k7uDxqRg99e-cxKyLkCgimMD8ZSO2m+1NdbFjg@mail.gmail.com \
--to=mike.leach@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=mathieu.poirier@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;
as well as URLs for NNTP newsgroup(s).