mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: James Clark <james.clark@arm.com>,
	linux-perf-users@vger.kernel.org, acme@kernel.org
Cc: linux-kernel@vger.kernel.org,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>,
	John Garry <john.g.garry@oracle.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] perf: cs-etm: Improve missing sink warning message
Date: Mon, 23 Jan 2023 18:02:36 +0000	[thread overview]
Message-ID: <0a5019bd-8666-45b1-bcaa-e3bacc869bc8@arm.com> (raw)
In-Reply-To: <20230123161114.261255-1-james.clark@arm.com>

On 23/01/2023 16:11, James Clark wrote:
> Make the sink error message more similar to the event error message that
> reminds about missing kernel support. The available sinks are also
> determined by the hardware so mention that too.
> 
> Also, usually it's not necessary to specify the sink, so add that as a
> hint.
> 
> Now the error for a made up sink looks like this:
> 
>    $ perf record -e cs_etm/@abc/
>    Couldn't find sink "abc" on event cs_etm/@abc/.
>    Missing kernel or device support? Errno: 2 (No such file or directory)
> 
>    Hint: An appropriate sink will picked automatically if none is specified.
> 
> Signed-off-by: James Clark <james.clark@arm.com>
> ---
>   tools/perf/arch/arm/util/cs-etm.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index 481e170cd3f1..c6195a7a3cbf 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -283,7 +283,9 @@ static int cs_etm_set_sink_attr(struct perf_pmu *pmu,
>   
>   		ret = perf_pmu__scan_file(pmu, path, "%x", &hash);
>   		if (ret != 1) {
> -			pr_err("failed to set sink \"%s\" on event %s with %d (%s)\n",
> +			pr_err("Couldn't find sink \"%s\" on event %s\n"

Could this be tied to "errno == ENOENT" ?  Otherwise, this could be 
guiding the user to wrong direction.

> +			       "Missing kernel or device support? errno: %d (%s)\n\n"
> +			       "Hint: An appropriate sink will picked automatically if one isn't specified.\n",

minor nit: "... sink will *be* picked.." ?

Otherwise, looks good to me.

Suzuki

>   			       sink, evsel__name(evsel), errno,
>   			       str_error_r(errno, msg, sizeof(msg)));
>   			return ret;
> 
> base-commit: 5670ebf54bd26482f57a094c53bdc562c106e0a9


      reply	other threads:[~2023-01-23 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 16:11 James Clark
2023-01-23 18:02 ` Suzuki K Poulose [this message]

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=0a5019bd-8666-45b1-bcaa-e3bacc869bc8@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@arm.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®