From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2CD6C433FE for ; Tue, 8 Nov 2022 20:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbiKHUuo (ORCPT ); Tue, 8 Nov 2022 15:50:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbiKHUun (ORCPT ); Tue, 8 Nov 2022 15:50:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2C14FF83; Tue, 8 Nov 2022 12:50:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54B9661789; Tue, 8 Nov 2022 20:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C2DAC433C1; Tue, 8 Nov 2022 20:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667940640; bh=NPpgBvtP8l9ohShELFg2NniEcgCrGhEDM/j1P5wv1g8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vJjOYUPyyRR4HyHcUsTcBTjY2VDReJ3KrdoEAlKgqNbFOheGReSWWDlYIGjE0rRfb MicxFvyAA0Ygm1L6ExbPXukuC1x/+7cVRfL8Y71+NeMqvecdK/EMvq935hB0pVZx9x ExKLzTAo5sCRgkH9nTeDYBqN2osa5p20IFjWsyqKDn8aBIqr56Q2HZ49IlqG16pooi hO0tXFEH0m6FGrxLfreghko8o/RcbuoZ87/jR707x+sW+Iutn+EQH8eIMtw/h7TE7X WVYyWOLNl0awlE3yH1lVO5LgSX6bLZl/9iehzW/sNz6Os8zCCAuyfN1vavv3fbZ/Rl 5KKk7DcV60MOw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B5A814034E; Tue, 8 Nov 2022 17:50:37 -0300 (-03) Date: Tue, 8 Nov 2022 17:50:37 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Kan Liang , Zhengjun Xing , James Clark Subject: Re: [PATCH 1/9] perf stat: Fix crash with --per-node --metric-only in CSV mode Message-ID: References: <20221107213314.3239159-1-namhyung@kernel.org> <20221107213314.3239159-2-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221107213314.3239159-2-namhyung@kernel.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org 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 > --- > 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