From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750898AbdCOCIi (ORCPT ); Tue, 14 Mar 2017 22:08:38 -0400 Received: from mga04.intel.com ([192.55.52.120]:50980 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdCOCIh (ORCPT ); Tue, 14 Mar 2017 22:08:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,166,1486454400"; d="asc'?scan'208";a="1122641204" Date: Wed, 15 Mar 2017 10:06:08 +0800 From: "Du, Changbin" To: changbin.du@intel.com Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf sort: only insert overhead && overhead_children when no overhead* field given Message-ID: <20170315020608.GA28871@intel.com> References: <20170313083601.24465-1-changbin.du@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <20170313083601.24465-1-changbin.du@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi, Arnaldo, Seems you missed this one. In some case, sort by 'Children' first doesn't m= ake sense, bacause I only care the 'Self' overhead. btw, does perf have a option that only calculate the *real* callee 'overhea= d_acc'? I mean only count the samples to parent when it is called by parent. For example, fun1 fun2 foo foo Then the 'overhead_acc' for fun1 should not include the samples that fun2 c= all foo. Thanks. changbin On Mon, Mar 13, 2017 at 04:36:01PM +0800, changbin.du@intel.com wrote: > From: Changbin Du >=20 > If we always insert 'overhead' and 'overhead_children' as sort keys, > this make it impossible to sort as overhead (which displayed as Self) > first. This patch forbid adding any overhead* field if there is one > already given. >=20 > Signed-off-by: Changbin Du > --- > tools/perf/util/sort.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c > index b6db140..7695b54 100644 > --- a/tools/perf/util/sort.c > +++ b/tools/perf/util/sort.c > @@ -2543,6 +2543,13 @@ static char *setup_overhead(char *keys) > if (sort__mode =3D=3D SORT_MODE__DIFF) > return keys; > =20 > + /* > + * Only insert overhead && overhead_children when > + * no overhead* field given. > + */ > + if (strstr(keys, "overhead")) > + return keys; > + > keys =3D prefix_if_not_in("overhead", keys); > =20 > if (symbol_conf.cumulate_callchain) > --=20 > 2.7.4 >=20 --=20 Thanks, Changbin Du --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYyKGQAAoJEAanuZwLnPNUIn4H/2DPXVi5C9CMKNuv6+fC7qa1 3txBVHSqlRPgCMQOOwygcXJVshe9FPNMDFYOcSToV1aTIcIyvXxgxphDTqQhg8gJ crmTzCExIaPWpva6nIVo7aoZ1+5nOacHdYVrOZegmk/RVPs/FlRgVfhKow02NkgX FrGFVLLrJMk4i47vUvnrMuyXEV8ySt4vbGHzPgbegyui98u9/iJ3VF0q+DMbYHrs 0NGrbz8n5C5pR/K7W6vAxslGBsC03QW9CIfr1BfqdG4wdn/z2oLKSSz9Ph05gW4N 0UgXIrzyqQ7kxQ2LIuFXW6sqk+qQdXyoRj8vijLvu5TbgT1IOIrvxVnxP/GZZGs= =PMco -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--