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] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_A9B852318A21F28D817C2F8209DA9E8EEB08@qq.com>
Date: Thu, 20 Feb 2025 11:49:37 +0800
From: Yangyu Chen <cyy@...self.name>
To: James Clark <james.clark@...aro.org>
Cc: linux-perf-users@...r.kernel.org,
 irogers@...gle.com,
 namhyung@...nel.org,
 Peter Zijlstra <peterz@...radead.org>,
 Ingo Molnar <mingo@...hat.com>,
 Arnaldo Carvalho de Melo <acme@...nel.org>,
 Mark Rutland <mark.rutland@....com>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
 Jiri Olsa <jolsa@...nel.org>,
 Adrian Hunter <adrian.hunter@...el.com>,
 "Liang, Kan" <kan.liang@...ux.intel.com>,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf list: Also append PMU name in verbose mode



> On 19 Feb 2025, at 23:16, James Clark <james.clark@...aro.org> wrote:
> 
> When listing in verbose mode, the long description is used but the PMU
> name isn't appended. There doesn't seem to be a reason to exclude it
> when asking for more information, so use the same print block for both
> long and short descriptions.
> 
> Before:
>  $ perf list -v
>  ...
>  inst_retired
>       [Instruction architecturally executed]
> 
> After:
>  $ perf list -v
>  ...
>   inst_retired
>       [Instruction architecturally executed. Unit: armv8_cortex_a57]
> 
> Signed-off-by: James Clark <james.clark@...aro.org>
> ---
> tools/perf/builtin-list.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index 9e7fdfcdd7ff..c19826f218a0 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -163,11 +163,10 @@ static void default_print_event(void *ps, const char *topic, const char *pmu_nam
> } else
> fputc('\n', fp);
> 
> - if (long_desc && print_state->long_desc) {
> - fprintf(fp, "%*s", 8, "[");
> - wordwrap(fp, long_desc, 8, pager_get_columns(), 0);
> - fprintf(fp, "]\n");
> - } else if (desc && print_state->desc) {
> + if (long_desc && print_state->long_desc)
> + desc = long_desc;
> +
> + if (desc && (print_state->desc || print_state->long_desc)) {
> char *desc_with_unit = NULL;
> int desc_len = -1;
> 
> -- 
> 2.34.1
> 
> When listing in verbose mode, the long description is used but the PMU
> name isn't appended. There doesn't seem to be a reason to exclude it
> when asking for more information, so use the same print block for both
> long and short descriptions.
> 
> Before:
>  $ perf list -v
>  ...
>  inst_retired
>       [Instruction architecturally executed]
> 
> After:
>  $ perf list -v
>  ...
>   inst_retired
>       [Instruction architecturally executed. Unit: armv8_cortex_a57]
> 
> Signed-off-by: James Clark <james.clark@...aro.org>
> ---
> tools/perf/builtin-list.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index 9e7fdfcdd7ff..c19826f218a0 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -163,11 +163,10 @@ static void default_print_event(void *ps, const char *topic, const char *pmu_nam
> } else
> fputc('\n', fp);
> 
> - if (long_desc && print_state->long_desc) {
> - fprintf(fp, "%*s", 8, "[");
> - wordwrap(fp, long_desc, 8, pager_get_columns(), 0);
> - fprintf(fp, "]\n");
> - } else if (desc && print_state->desc) {
> + if (long_desc && print_state->long_desc)
> + desc = long_desc;
> +
> + if (desc && (print_state->desc || print_state->long_desc)) {
> char *desc_with_unit = NULL;
> int desc_len = -1;
> 
> -- 
> 2.34.1
> 
> When listing in verbose mode, the long description is used but the PMU
> name isn't appended. There doesn't seem to be a reason to exclude it
> when asking for more information, so use the same print block for both
> long and short descriptions.
> 
> Before:
>  $ perf list -v
>  ...
>  inst_retired
>       [Instruction architecturally executed]
> 
> After:
>  $ perf list -v
>  ...
>   inst_retired
>       [Instruction architecturally executed. Unit: armv8_cortex_a57]
> 
> Signed-off-by: James Clark <james.clark@...aro.org>

Tested-by: Yangyu Chen <cyy@...self.name>

Thanks,
Yangyu Chen


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ