From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbcCFSo0 (ORCPT ); Sun, 6 Mar 2016 13:44:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbcCFSoS (ORCPT ); Sun, 6 Mar 2016 13:44:18 -0500 Date: Sun, 6 Mar 2016 19:43:25 +0100 From: Jiri Olsa To: Namhyung Kim 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: <20160306184325.GA12092@krava> References: <1457103582-28396-1-git-send-email-namhyung@kernel.org> <1457103582-28396-3-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457103582-28396-3-git-send-email-namhyung@kernel.org> 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 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 ;-) thanks, jirka