All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: mike.leach@linaro.org, linux-arm-kernel@lists.infradead.org,
	coresight@lists.linaro.org, mathieu.poirier@linaro.org
Cc: acme@kernel.org
Subject: Re: [PATCH v4 5/5] coresight: sysfs: Allow select default sink on source enable.
Date: Tue, 2 Jun 2020 12:51:15 +0100	[thread overview]
Message-ID: <62411834-9273-e46c-dc34-71ae45013b96@arm.com> (raw)
In-Reply-To: <20200526104642.9526-6-mike.leach@linaro.org>

Hi Mike,

On 05/26/2020 11:46 AM, Mike Leach wrote:
> When enabling a trace source using sysfs, allow the CoreSight system to
> auto-select a default sink if none has been enabled by the user.
> 
> Uses the sink select algorithm that uses the default select priorities
> set when sinks are registered with the system. At present this will
> prefer ETR over ETB / ETF.
> 
> Signed-off-by: Mike Leach <mike.leach@linaro.org>
> ---
>   drivers/hwtracing/coresight/coresight.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
> index 7632d060e25d..bd1a52a65d00 100644
> --- a/drivers/hwtracing/coresight/coresight.c
> +++ b/drivers/hwtracing/coresight/coresight.c
> @@ -965,8 +965,15 @@ int coresight_enable(struct coresight_device *csdev)
>   	 */
>   	sink = coresight_get_enabled_sink(false);
>   	if (!sink) {
> -		ret = -EINVAL;
> -		goto out;
> +		/* look for a default sink if nothing enabled */
> +		sink = coresight_find_default_sink(csdev);
> +		if (!sink) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		/* mark the default as enabled */
> +		sink->activated = true;
> +		dev_info(&sink->dev, "Enabled default sink.");
>   	}

To be honest, I would drop this change and mandate that the
user enables the sink(s). There is no way to reliably match
which ETM is tracing to the sink above in case multiple ETMs
are being enabled, even with the above message. It is important
for sysfs mode, as the user must collect the trace data manually,
unlike the perf mode where the race data is collected and presented to
the user via memory buffers.

Suzuki

_______________________________________________
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 11:46 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
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 [this message]
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=62411834-9273-e46c-dc34-71ae45013b96@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=acme@kernel.org \
    --cc=coresight@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    /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.