From: Mike Leach <mike.leach@linaro.org>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Coresight ML <coresight@lists.linaro.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 4/5] coresight: etm: perf: Add default sink selection to etm perf
Date: Tue, 2 Jun 2020 14:12:40 +0100 [thread overview]
Message-ID: <CAJ9a7ViUVAttf3-Mb4zVeJ6+Ty=4yxg3MZeGPcGDc0UMVY_Xtg@mail.gmail.com> (raw)
In-Reply-To: <51fcc1b5-a4ab-04d1-e395-95df9f4745f7@arm.com>
Hi Suzuki,
On Tue, 2 Jun 2020 at 12:40, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>
> On 05/26/2020 11:46 AM, Mike Leach wrote:
> > Add default sink selection to the perf trace handling in the etm driver.
> > Uses the select default sink infrastructure to select a sink for the perf
> > session, if no other sink is specified.
> >
> > Signed-off-by: Mike Leach <mike.leach@linaro.org>
>
> This patch looks fine to me as such. But please see below for some
> discussion on the future support for other configurations.
>
>
> > ---
> > .../hwtracing/coresight/coresight-etm-perf.c | 17 ++++++++++++++---
> > 1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
> > index 84f1dcb69827..1a3169e69bb1 100644
> > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> > @@ -226,9 +226,6 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
> > sink = coresight_get_enabled_sink(true);
> > }
> >
> > - if (!sink)
> > - goto err;
> > -
> > mask = &event_data->mask;
> >
> > /*
> > @@ -253,6 +250,16 @@ static void *etm_setup_aux(struct perf_event *event, void **pages,
> > continue;
> > }
> >
> > + /*
> > + * No sink provided - look for a default sink for one of the
> > + * devices. At present we only support topology where all CPUs
> > + * use the same sink [N:1], so only need to find one sink. The
> > + * coresight_build_path later will remove any CPU that does not
> > + * attach to the sink, or if we have not found a sink.
> > + */
> > + if (!sink)
> > + sink = coresight_find_default_sink(csdev);
> > +
>
> While we are here, should we remove the "find enabled sink" if the csink
> is not specified via config. ? That step is problematic, as the user may
> not remember which sinks were enabled. Also, we can't hit that with
> perf tool as it prevents any invocation without sink (until this change).
>
> So may be this is a good time to get rid of that ?
>
You are correct - the 'sink = coresight_get_enabled_sink(true);' was
dead code until this patch.
However - if someone has set up their system using sysfs to enable
sinks, then should we not respect that rather than assume they made a
mistake?
Thinking about N:M topologies mentioned below - one method of handling
this is to enable relevant sinks and then let perf trace on any cores
that might use them.
> Also, we may need to do special handling for cases where there multiple
> sinks (ETRS) and the cpus in the event mask has different preferred
> sink. We can defer it for now as we don't claim to support such
> configurations yet.
Yes - the newer topologies will need some changes - beyond what we are
handling here.
However - especially for 1:1 - the best way may be to always use the
default sink - as specifying multiple sinks on the perf command line
may be problematical.
> When we do, we could either :
>
> 1) Make sure the event is bound to a single CPU, in which case
> the sink remains the same for the event.
>
> OR
>
> 2) All the different "preferred" sinks (ETRs selected by the ETM) have
> the same capabilitiy. i.e, we can move around the "sink" specific
> buffers and use them where we end up using.
If here by "capabilities" we are talking about buffer vs system memory
type sinks then I agree. We may need in future to limit the search
algorithm to ensure that only the best system memory type sinks are
found and eliminate cores attached to only buffer type sinks.
>
> We can defer all of this, until we get platforms which ned the support.
>
> Suzuki
Thanks for the review.
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:[~2020-06-02 13:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 10:46 [PATCH v4 0/5] Update CoreSight infrastructure to select a default sink Mike Leach
2020-05-26 10:46 ` [PATCH v4 1/5] coresight: Fix comment in main header file Mike Leach
2020-05-26 14:49 ` Suzuki K Poulose
2020-06-04 21:14 ` Mathieu Poirier
2020-05-26 10:46 ` [PATCH v4 2/5] coresight: Add default sink selection to CoreSight base Mike Leach
2020-06-02 10:25 ` Suzuki K Poulose
2020-06-02 14:20 ` Mike Leach
2020-06-04 21:17 ` Mathieu Poirier
2020-05-26 10:46 ` [PATCH v4 3/5] coresight: tmc: Update sink types for default selection Mike Leach
2020-06-02 10:31 ` Suzuki K Poulose
2020-06-04 21:18 ` Mathieu Poirier
2020-05-26 10:46 ` [PATCH v4 4/5] coresight: etm: perf: Add default sink selection to etm perf Mike Leach
2020-06-02 11:45 ` Suzuki K Poulose
2020-06-02 13:12 ` Mike Leach [this message]
2020-06-02 13:29 ` Suzuki K Poulose
2020-06-02 16:59 ` Mathieu Poirier
2020-06-04 21:07 ` Mike Leach
2020-06-04 21:18 ` Mathieu Poirier
2020-05-26 10:46 ` [PATCH v4 5/5] coresight: sysfs: Allow select default sink on source enable Mike Leach
2020-06-02 11:51 ` Suzuki K Poulose
2020-06-04 21:12 ` 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='CAJ9a7ViUVAttf3-Mb4zVeJ6+Ty=4yxg3MZeGPcGDc0UMVY_Xtg@mail.gmail.com' \
--to=mike.leach@linaro.org \
--cc=acme@kernel.org \
--cc=coresight@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mathieu.poirier@linaro.org \
--cc=suzuki.poulose@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;
as well as URLs for NNTP newsgroup(s).