[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Mar 2016 14:40:33 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>,
Stephane Eranian <eranian@...gle.com>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 2/8] perf tools: Introduce perf_hpp__setup_hists_formats()
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 <namhyung@...nel.org>
> ---
> 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
jirka
Powered by blists - more mailing lists