All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/5] coresight: Add default sink selection to CoreSight base
Date: Tue, 2 Jun 2020 15:20:58 +0100	[thread overview]
Message-ID: <CAJ9a7Vh2+h=+VdAZcTzjoXfeY5Jng9S1CtrGo-7j3LSYHvho3Q@mail.gmail.com> (raw)
In-Reply-To: <350f19a1-bdba-c464-9fd3-68c77daea4b0@arm.com>

Hi Suzuki,

On Tue, 2 Jun 2020 at 11:20, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>
> On 05/26/2020 11:46 AM, Mike Leach wrote:
> > Adds a method to select a suitable sink connected to a given source.
> >
> > In cases where no sink is defined, the coresight_find_default_sink
> > routine can search from a given source, through the child connections
> > until a suitable sink is found.
> >
> > The suitability is defined in by the sink coresight_dev_subtype on the
> > CoreSight device, and the distance from the source by counting
> > connections.
> >
> > Higher value subtype is preferred - where these are equal, shorter
> > distance from source is used as a tie-break.
> >
> > This allows for default sink to be discovered were none is specified
> > (e.g. perf command line)
> >
> > Signed-off-by: Mike Leach <mike.leach@linaro.org>
>
> Feel free to add:
> Suggested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>

Will do.

> > +/**
> > + * coresight_find_default_sink: Find a sink suitable for use as a
> > + * default sink.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.


> > + *
> > + * @csdev: starting source to find a connected sink.
> > + *
> > + * Walks connections graph looking for a suitable sink to enable for the
> > + * supplied source. Uses CoreSight device subtypes and distance from source
> > + * to select the best sink.
> > + *
> > + * If a sink is found, then the default sink for this device is set and
> > + * will be automatically used in future.
> > + *
> > + * Used in cases where the CoreSight user (perf / sysfs) has not selected a
> > + * sink.
> > + */
> > +struct coresight_device *
> > +coresight_find_default_sink(struct coresight_device *csdev)
> > +{
> > +     int depth = 0;
> > +
> > +     /* look for a default sink if we have not found for this device */
> > +     if (!csdev->def_sink)
> > +             csdev->def_sink = coresight_find_sink(csdev, &depth);
>
> Could we add a helper to clear the cached "def-sink" from all the
> "sources", when the sink is going away ? You may be able to do this via
> coresight_remove_match()
>

Is this needed in the current state of the CoreSight driver
infrastructure? The topology is fixed for the lifetime of the device
so a sink cannot disappear without the rest of the CoreSight going
away - i.e. reboot / shutdown.
If there is concern about a race condition then something similar to
coresight_remove_match can be developed, but the actual function only
works on immediate connections / output ports.

Thanks

Mike


> Rest looks good to me.
> Suzuki
>
>


--
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

  reply	other threads:[~2020-06-02 14:21 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 [this message]
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
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='CAJ9a7Vh2+h=+VdAZcTzjoXfeY5Jng9S1CtrGo-7j3LSYHvho3Q@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.