lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0a5019bd-8666-45b1-bcaa-e3bacc869bc8@arm.com>
Date:   Mon, 23 Jan 2023 18:02:36 +0000
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     James Clark <james.clark@....com>,
        linux-perf-users@...r.kernel.org, acme@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Mike Leach <mike.leach@...aro.org>,
        Leo Yan <leo.yan@...aro.org>,
        John Garry <john.g.garry@...cle.com>,
        Will Deacon <will@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>, coresight@...ts.linaro.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] perf: cs-etm: Improve missing sink warning message

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/@.../
>    Couldn't find sink "abc" on event cs_etm/@.../.
>    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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ