perf hists: Use own hpp_list for hierarchy mode

Now each hists has its own hpp lists in hierarchy.  So instead of having
a pointer to a single perf_hpp_fmt in a hist entry, make it point the
hpp_list for its level.  This will be used to support multiple sort keys
in a single hierarchy level.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1457361308-514-3-git-send-email-namhyung@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Namhyung Kim
2016-03-07 16:44:46 -03:00
committed by Ingo Molnar
parent c3bc0c4368
commit 1b2dbbf41a
7 changed files with 101 additions and 71 deletions

View File

@@ -412,6 +412,7 @@ static void perf_gtk__add_hierarchy_entries(struct hists *hists,
for (node = rb_first(root); node; node = rb_next(node)) {
GtkTreeIter iter;
float percent;
char *bf;
he = rb_entry(node, struct hist_entry, rb_node);
if (he->filtered)
@@ -437,13 +438,20 @@ static void perf_gtk__add_hierarchy_entries(struct hists *hists,
gtk_tree_store_set(store, &iter, col_idx++, hpp->buf, -1);
}
fmt = he->fmt;
if (fmt->color)
fmt->color(fmt, hpp, he);
else
fmt->entry(fmt, hpp, he);
bf = hpp->buf;
perf_hpp_list__for_each_format(he->hpp_list, fmt) {
int ret;
gtk_tree_store_set(store, &iter, col_idx, rtrim(hpp->buf), -1);
if (fmt->color)
ret = fmt->color(fmt, hpp, he);
else
ret = fmt->entry(fmt, hpp, he);
snprintf(hpp->buf + ret, hpp->size - ret, " ");
advance_hpp(hpp, ret + 2);
}
gtk_tree_store_set(store, &iter, col_idx, rtrim(bf), -1);
if (!he->leaf) {
perf_gtk__add_hierarchy_entries(hists, &he->hroot_out,