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 E7822C433FE for ; Thu, 6 Oct 2022 14:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbiJFODR (ORCPT ); Thu, 6 Oct 2022 10:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbiJFODQ (ORCPT ); Thu, 6 Oct 2022 10:03:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0480FA7A88 for ; Thu, 6 Oct 2022 07:03:16 -0700 (PDT) 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 9AB0D6199B for ; Thu, 6 Oct 2022 14:03:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C96E8C433D6; Thu, 6 Oct 2022 14:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665064995; bh=wf7OSuh0L2i4XtkdDkRXHGr/tdQFot0vIQqK82uYxKg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7D7v3DBFqVsqVCVxOBn9y+EWoEX3gcezoz6NUB8TzrKozXLmDY9Rv/2yBfjNrb/0 gtOwN4iTy0v/8JZpUsZh/JO0gLvRmAr6hUUYfpvmKNvmuZ9iaVGRdPJjDIILvE6vle bCP/i0wVRGdhvI20OrSpU0D72xjbdXaArNTPXyUc34KoTy/uwYU3Ew/ACwTU6ksKqi 9QpYdN48a0JsELoDd0fi7aJGFR5PqR7j6RHYYrVUjcw1LSOcch/tf5+D2rINL9coD4 Wp42iPuqhtXn6BVfQ0LRIc+m4MW/Jl9S4nNYlG1zTJv1+asgoQpDuwoAMlsMFaG669 VG7Y8I5yofPhg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 850914062C; Thu, 6 Oct 2022 11:03:12 -0300 (-03) Date: Thu, 6 Oct 2022 11:03:12 -0300 From: Arnaldo Carvalho de Melo To: Athira Rajeev Cc: Ian Rogers , maddy@linux.vnet.ibm.com, Nageswara Sastry , Kajol Jain , linux-perf-users , James Clark , Jiri Olsa , atrajeev , Disha Goel , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] tools/perf: Fix aggr_printout to display cpu field irrespective of core value Message-ID: References: <993a1391ee931e859d972c460644d171@imap.linux.ibm.com> <6A5D0603-CF66-43B4-A13F-0308CF01967A@linux.vnet.ibm.com> <137635B2-F4E8-4C65-B797-5C6511E265A8@linux.vnet.ibm.com> <3D36EC01-B516-46CA-BC71-010617DB4A9D@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D36EC01-B516-46CA-BC71-010617DB4A9D@linux.vnet.ibm.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Thu, Oct 06, 2022 at 06:16:14PM +0530, Athira Rajeev escreveu: > > > > On 05-Oct-2022, at 6:05 PM, Arnaldo Carvalho de Melo wrote: > > > > Em Wed, Oct 05, 2022 at 09:28:52AM -0300, Arnaldo Carvalho de Melo escreveu: > >> Em Wed, Oct 05, 2022 at 10:23:39AM +0530, Athira Rajeev escreveu: > >>> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > >>> index b82844cb0ce7..cf28020798ec 100644 > >>> --- a/tools/perf/util/stat-display.c > >>> +++ b/tools/perf/util/stat-display.c > >>> @@ -168,7 +168,7 @@ static void aggr_printout(struct perf_stat_config *config, > >>> id.socket, > >>> id.die, > >>> id.core); > >>> - } else if (id.core > -1) { > >>> + } else if (id.cpu.cpu > -1) { > >>> fprintf(config->output, "\"cpu\" : \"%d\", ", > >>> id.cpu.cpu); > >>> } > >>> @@ -179,7 +179,7 @@ static void aggr_printout(struct perf_stat_config *config, > >>> id.die, > >>> config->csv_output ? 0 : -3, > >>> id.core, config->csv_sep); > >>> - } else if (id.core > -1) { > >>> + } else if (id.cpu.cpu > -1) { > >>> fprintf(config->output, "CPU%*d%s", > >>> config->csv_output ? 0 : -7, > >>> id.cpu.cpu, config->csv_sep); > >>> -- > >>> If it is confusing, shall I send it as a separate patch along with Tested-by from Ian ? > >> > >> I'll have to do this by hand, tried pointing b4 to this message and it > >> picked the old one, also tried to save the message and apply by hand, > >> its mangled. > > > > This is what I have now, will force push later, please triple check :-) > > > Sorry for all the confusion Arnaldo. Hereafter, I will resubmit the patch to avoid this. > In below patch which you shared, code change is correct. But commit message is different. > So to avoid further confusion, I went ahead and posted a separate patch in the mailing list with: > > subject: [PATCH] tools/perf: Fix cpu check to use id.cpu.cpu in aggr_printout > Patch link: https://lore.kernel.org/lkml/20221006114225.66303-1-atrajeev@linux.vnet.ibm.com/T/#u > > Please pick the separately send patch. Ok, will do. - Arnaldo