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: <83aa958a-5bd6-06eb-06a4-39e51e2eb3b5@huawei.com>
Date: Fri, 28 Jun 2024 10:33:33 +0800
From: Yicong Yang <yangyicong@...wei.com>
To: Namhyung Kim <namhyung@...nel.org>, Arnaldo Carvalho de Melo
	<acme@...nel.org>, Ian Rogers <irogers@...gle.com>, Kan Liang
	<kan.liang@...ux.intel.com>
CC: <yangyicong@...ilicon.com>, Jiri Olsa <jolsa@...nel.org>, Adrian Hunter
	<adrian.hunter@...el.com>, Peter Zijlstra <peterz@...radead.org>, Ingo Molnar
	<mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	<linux-perf-users@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] perf stat: Fix a segfault with --per-cluster
 --metric-only

Hi Namhyung,

On 2024/6/28 8:06, Namhyung Kim wrote:
> The new --per-cluster option was added recently but it forgot to update
> the aggr_header fields which are used for --metric-only option.  And it
> resulted in a segfault due to NULL string in fputs().
> 
> Fixes: cbc917a1b03b ("perf stat: Support per-cluster aggregation")
> Cc: Yicong Yang <yangyicong@...ilicon.com>

Thanks for fixing this.

Reviewed-by: Yicong Yang <yangyicong@...ilicon.com>

Tested on my cluster machine and this patch fixes the issue:

[root@...alhost perf]# ./perf-before stat -M TopDownL1 --per-cluster --metric-only --timeout 100 -x ,
Segmentation fault (core dumped)
[root@...alhost perf]# ./perf-after stat -M TopDownL1 --per-cluster --metric-only --timeout 100 -x ,
cluster,cpus,retiring,bad_speculation,backend_bound,frontend_bound,
S56-D0-CLS158,4,0.03,0.00,0.96,0.00,
[...]

So,

Tested-by: Yicong Yang <yangyicong@...ilicon.com>

Thanks.

> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/stat-display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 91d2f7f65df7..186305fd2d0e 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -38,6 +38,7 @@
>  static int aggr_header_lens[] = {
>  	[AGGR_CORE] 	= 18,
>  	[AGGR_CACHE]	= 22,
> +	[AGGR_CLUSTER]	= 20,
>  	[AGGR_DIE] 	= 12,
>  	[AGGR_SOCKET] 	= 6,
>  	[AGGR_NODE] 	= 6,
> @@ -49,6 +50,7 @@ static int aggr_header_lens[] = {
>  static const char *aggr_header_csv[] = {
>  	[AGGR_CORE] 	= 	"core,cpus,",
>  	[AGGR_CACHE]	= 	"cache,cpus,",
> +	[AGGR_CLUSTER]	= 	"cluster,cpus,",
>  	[AGGR_DIE] 	= 	"die,cpus,",
>  	[AGGR_SOCKET] 	= 	"socket,cpus,",
>  	[AGGR_NONE] 	= 	"cpu,",
> @@ -60,6 +62,7 @@ static const char *aggr_header_csv[] = {
>  static const char *aggr_header_std[] = {
>  	[AGGR_CORE] 	= 	"core",
>  	[AGGR_CACHE] 	= 	"cache",
> +	[AGGR_CLUSTER]	= 	"cluster",
>  	[AGGR_DIE] 	= 	"die",
>  	[AGGR_SOCKET] 	= 	"socket",
>  	[AGGR_NONE] 	= 	"cpu",
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ