From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756852AbcCCXyI (ORCPT ); Thu, 3 Mar 2016 18:54:08 -0500 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:45097 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbcCCXyG (ORCPT ); Thu, 3 Mar 2016 18:54:06 -0500 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 165.244.98.204 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Fri, 4 Mar 2016 08:53:57 +0900 From: Namhyung Kim To: Jiri Olsa CC: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Stephane Eranian , Wang Nan Subject: Re: [PATCH 2/8] perf tools: Introduce perf_hpp__setup_hists_formats() Message-ID: <20160303235357.GC16631@sejong> References: <1456935128-31299-1-git-send-email-namhyung@kernel.org> <1456935128-31299-3-git-send-email-namhyung@kernel.org> <20160303134033.GB5487@krava.redhat.com> MIME-Version: 1.0 In-Reply-To: <20160303134033.GB5487@krava.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/04 08:53:59, Serialize by Router on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/04 08:53:59, Serialize complete at 2016/03/04 08:53:59 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 03, 2016 at 02:40:33PM +0100, Jiri Olsa wrote: > On Thu, Mar 03, 2016 at 01:12:02AM +0900, Namhyung Kim wrote: > > The perf_hpp__setup_hists_formats() is to build hists-specific output > > formats (and sort keys). Currently it's only used in order to build the > > output format in a hierarchy with same sort keys, but it could be used > > with different sort keys in non-hierarchy mode later. > > > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/ui/hist.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > tools/perf/util/hist.c | 12 +++++++++ > > tools/perf/util/hist.h | 10 ++++++++ > > tools/perf/util/sort.c | 29 ++++++++++++++++++++++ > > 4 files changed, 117 insertions(+) > > > > diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c > > index 7c0585c146e1..ded564936701 100644 > > --- a/tools/perf/ui/hist.c > > +++ b/tools/perf/ui/hist.c > > @@ -5,6 +5,7 @@ > > #include "../util/util.h" > > #include "../util/sort.h" > > #include "../util/evsel.h" > > +#include "../util/evlist.h" > > > > /* hist period print (hpp) functions */ > > > > @@ -715,3 +716,68 @@ void perf_hpp__set_user_width(const char *width_list_str) > > break; > > } > > } > > + > > +static int add_hierarchy_fmt(struct hists *hists, struct perf_hpp_fmt *fmt) > > +{ > > + struct perf_hpp_list_node *node = NULL; > > + struct perf_hpp_fmt *fmt_copy; > > + bool found = false; > > + > > + list_for_each_entry(node, &hists->hpp_formats, list) { > > + struct perf_hpp_fmt *pos; > > + > > + pos = list_first_entry(&node->hpp.fields, struct perf_hpp_fmt, list); > > the struct perf_hpp_list_node could hold 'level' as well, > so you wouldn't need to query first fmt Will change. Thanks, Namhyung