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: <Y2rBHW39Z5PQAhDV@kernel.org>
Date:   Tue, 8 Nov 2022 17:50:37 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        linux-perf-users@...r.kernel.org,
        Kan Liang <kan.liang@...ux.intel.com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        James Clark <james.clark@....com>
Subject: Re: [PATCH 1/9] perf stat: Fix crash with --per-node --metric-only
 in CSV mode

Em Mon, Nov 07, 2022 at 01:33:06PM -0800, Namhyung Kim escreveu:
> The following command will get segfault due to missing aggr_header_csv
> for AGGR_NODE:
> 
>   $ sudo perf stat -a --per-node -x, --metric-only true

Thanks, applied to perf/urgent.

- Arnaldo
 
> Fixes: 86895b480a2f ("perf stat: Add --per-node agregation support")
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/stat-display.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 657434cd29ee..ea41e6308c50 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -534,7 +534,7 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int
>  			[AGGR_CORE] = 2,
>  			[AGGR_THREAD] = 1,
>  			[AGGR_UNSET] = 0,
> -			[AGGR_NODE] = 0,
> +			[AGGR_NODE] = 1,
>  		};
>  
>  		pm = config->metric_only ? print_metric_only_csv : print_metric_csv;
> @@ -819,6 +819,7 @@ static int aggr_header_lens[] = {
>  	[AGGR_SOCKET] = 12,
>  	[AGGR_NONE] = 6,
>  	[AGGR_THREAD] = 24,
> +	[AGGR_NODE] = 6,
>  	[AGGR_GLOBAL] = 0,
>  };
>  
> @@ -828,6 +829,7 @@ static const char *aggr_header_csv[] = {
>  	[AGGR_SOCKET] 	= 	"socket,cpus",
>  	[AGGR_NONE] 	= 	"cpu,",
>  	[AGGR_THREAD] 	= 	"comm-pid,",
> +	[AGGR_NODE] 	= 	"node,",
>  	[AGGR_GLOBAL] 	=	""
>  };
>  
> -- 
> 2.38.1.431.g37b22c650d-goog

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ