lkml.org 
[lkml]   [2016]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/8] perf tools: Introduce perf_hpp__setup_hists_formats()
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

\
 
 \ /
  Last update: 2016-03-06 20:21    [W:1.401 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site