diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-03-07 14:44:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-03-08 04:11:19 -0500 |
commit | 1b2dbbf41a0f4cf7a5662bccb9a18128d16e5ffb (patch) | |
tree | 284079169d6939125553b2946ebd2318019029d8 /tools/perf/ui/gtk/hists.c | |
parent | c3bc0c436899d01c3a09fddb308d487cc032fbd2 (diff) |
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>
Diffstat (limited to 'tools/perf/ui/gtk/hists.c')
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index a5758fdfbe1f..4534e2d7669c 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -412,6 +412,7 @@ static void perf_gtk__add_hierarchy_entries(struct hists *hists, | |||
412 | for (node = rb_first(root); node; node = rb_next(node)) { | 412 | for (node = rb_first(root); node; node = rb_next(node)) { |
413 | GtkTreeIter iter; | 413 | GtkTreeIter iter; |
414 | float percent; | 414 | float percent; |
415 | char *bf; | ||
415 | 416 | ||
416 | he = rb_entry(node, struct hist_entry, rb_node); | 417 | he = rb_entry(node, struct hist_entry, rb_node); |
417 | if (he->filtered) | 418 | if (he->filtered) |
@@ -437,13 +438,20 @@ static void perf_gtk__add_hierarchy_entries(struct hists *hists, | |||
437 | gtk_tree_store_set(store, &iter, col_idx++, hpp->buf, -1); | 438 | gtk_tree_store_set(store, &iter, col_idx++, hpp->buf, -1); |
438 | } | 439 | } |
439 | 440 | ||
440 | fmt = he->fmt; | 441 | bf = hpp->buf; |
441 | if (fmt->color) | 442 | perf_hpp_list__for_each_format(he->hpp_list, fmt) { |
442 | fmt->color(fmt, hpp, he); | 443 | int ret; |
443 | else | 444 | |
444 | fmt->entry(fmt, hpp, he); | 445 | if (fmt->color) |
446 | ret = fmt->color(fmt, hpp, he); | ||
447 | else | ||
448 | ret = fmt->entry(fmt, hpp, he); | ||
449 | |||
450 | snprintf(hpp->buf + ret, hpp->size - ret, " "); | ||
451 | advance_hpp(hpp, ret + 2); | ||
452 | } | ||
445 | 453 | ||
446 | gtk_tree_store_set(store, &iter, col_idx, rtrim(hpp->buf), -1); | 454 | gtk_tree_store_set(store, &iter, col_idx, rtrim(bf), -1); |
447 | 455 | ||
448 | if (!he->leaf) { | 456 | if (!he->leaf) { |
449 | perf_gtk__add_hierarchy_entries(hists, &he->hroot_out, | 457 | perf_gtk__add_hierarchy_entries(hists, &he->hroot_out, |