Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbdCMO5k (ORCPT ); Mon, 13 Mar 2017 10:57:40 -0400 Received: from mail.kernel.org ([198.145.29.136]:46210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdCMO5Y (ORCPT ); Mon, 13 Mar 2017 10:57:24 -0400 Date: Mon, 13 Mar 2017 11:57:18 -0300 From: Arnaldo Carvalho de Melo To: changbin.du@intel.com Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf report: show sort_order in title Message-ID: <20170313145718.GP2750@kernel.org> References: <20170313083635.24525-1-changbin.du@intel.com> <20170313144714.GO2750@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170313144714.GO2750@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2650 Lines: 60 Em Mon, Mar 13, 2017 at 11:47:14AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, Mar 13, 2017 at 04:36:35PM +0800, changbin.du@intel.com escreveu: > > From: Changbin Du > > > > In the report, how does the data sort is a important info for > > analyser. Moreover, perf sometimes insert or append sort fields > > automatically. Thus user may confuse how it sorts w/o reading > > perf internal. So here print the order info to repor title. > > > > Signed-off-by: Changbin Du > > --- > > tools/perf/ui/browsers/hists.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > > > > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c > > index fc4fb66..6c6b615 100644 > > --- a/tools/perf/ui/browsers/hists.c > > +++ b/tools/perf/ui/browsers/hists.c > > @@ -2194,6 +2194,25 @@ static inline bool is_report_browser(void *timer) > > return timer == NULL; > > } > > > > +static int get_sort_fields_str(struct hists *hists, char *buf, size_t size) > > I'll just rename this to use the tools/perf/ style for such functions, > making it: > > static int hists__scnprintf_sort_fields(hists, buf, size) But then, while testing, Before: $ perf report Samples: 405 of event 'cycles', Event count (approx.): 101733003 Overhead Command Shared Object Symbol 11.15% swapper [kernel.vmlinux] [k] intel_idle 3.00% firefox libxul.so [.] 0x0000000001298b8d 1.74% swapper [kernel.vmlinux] [k] update_blocked_averages 1.69% qemu-system-x86 [kernel.vmlinux] [k] __fget 1.18% swapper [kernel.vmlinux] [k] update_wall_time Tip: Save output of perf stat using: perf stat record After: $ perf report Samples: 405 of event 'cycles', Event count (approx.): 101733003, Sort by: Children,Overhead,Command,Shared Object,Symbol Overhead Command Shared Object Symbol 11.15% swapper [kernel.vmlinux] [k] intel_idle 3.00% firefox libxul.so [.] 0x0000000001298b8d 1.74% swapper [kernel.vmlinux] [k] update_blocked_averages 1.69% qemu-system-x86 [kernel.vmlinux] [k] __fget 1.18% swapper [kernel.vmlinux] [k] update_wall_time I see now duplication of info, where is the value? Can you show the usecase in a compelling way? - Arnaldo