From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752804AbcCGNBD (ORCPT ); Mon, 7 Mar 2016 08:01:03 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34140 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbcCGNA5 (ORCPT ); Mon, 7 Mar 2016 08:00:57 -0500 Date: Mon, 7 Mar 2016 21:59:34 +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 v2 2/8] perf tools: Introduce perf_hpp__setup_hists_formats() Message-ID: <20160307125934.GD22896@danjae.kornet> References: <1457103582-28396-1-git-send-email-namhyung@kernel.org> <1457103582-28396-3-git-send-email-namhyung@kernel.org> <20160306184325.GA12092@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160306184325.GA12092@krava> 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 On Sun, Mar 06, 2016 at 07:43:25PM +0100, Jiri Olsa wrote: > On Fri, Mar 04, 2016 at 11:59:36PM +0900, Namhyung Kim wrote: > > SNIP > > > > > @@ -2133,8 +2134,19 @@ static void hists__delete_all_entries(struct hists *hists) > > static void hists_evsel__exit(struct perf_evsel *evsel) > > { > > struct hists *hists = evsel__hists(evsel); > > + struct perf_hpp_fmt *fmt, *pos; > > + struct perf_hpp_list_node *node; > > > > hists__delete_all_entries(hists); > > + > > + list_for_each_entry(node, &hists->hpp_formats, list) { > > + perf_hpp_list__for_each_format_safe(&node->hpp, fmt, pos) { > > + list_del(&fmt->list); > > + free(fmt); > > + } > > + list_del(&node->list); > > + free(node); > > + } > > } > > > > static int hists_evsel__init(struct perf_evsel *evsel) > > diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h > > index f4ef513527ba..3cab9dc20822 100644 > > --- a/tools/perf/util/hist.h > > +++ b/tools/perf/util/hist.h > > @@ -78,6 +78,7 @@ struct hists { > > u16 col_len[HISTC_NR_COLS]; > > int socket_filter; > > struct perf_hpp_list *hpp_list; > > + struct list_head hpp_formats; > > I've been thinking.. should hpp_formats and hpp_list be merged? something like: > > struct perf_hpp_list { > struct list_head nodes; > int levels; > } > > sturct perf_hpp_list_node { > int level; > struct list_head fields; > struct list_head sorts; > int nr_sort_keys; > }; > > it seems wrong to me that your hierarchy code and current one > got in separate paths.. we could have the new hierarchy support > struct above being used in current non-hierarchy code just > by using single level > > I haven't thought all this through.. just an idea ;-) Yes, I also think that we need to converge on the same data structure eventually. But I think it's too intrusive to be merged at once. Also keeping up with the latest perf changes is a PITA. ;-) So I decided to use it on the hierarchy first, and get tested in the wild for some time. After that we can convert the non-hierarchy code to use same path and data structure gradually IMHO. Thanks, Namhyung