diff options
Diffstat (limited to 'tools/perf/ui/gtk/hists.c')
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 9d90683914d4..6ca60e482cdc 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -47,11 +47,26 @@ static int perf_gtk__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, | |||
47 | __percent_color_snprintf, true); \ | 47 | __percent_color_snprintf, true); \ |
48 | } | 48 | } |
49 | 49 | ||
50 | #define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \ | ||
51 | static u64 he_get_acc_##_field(struct hist_entry *he) \ | ||
52 | { \ | ||
53 | return he->stat_acc->_field; \ | ||
54 | } \ | ||
55 | \ | ||
56 | static int perf_gtk__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \ | ||
57 | struct perf_hpp *hpp, \ | ||
58 | struct hist_entry *he) \ | ||
59 | { \ | ||
60 | return __hpp__fmt_acc(hpp, he, he_get_acc_##_field, " %6.2f%%", \ | ||
61 | __percent_color_snprintf, true); \ | ||
62 | } | ||
63 | |||
50 | __HPP_COLOR_PERCENT_FN(overhead, period) | 64 | __HPP_COLOR_PERCENT_FN(overhead, period) |
51 | __HPP_COLOR_PERCENT_FN(overhead_sys, period_sys) | 65 | __HPP_COLOR_PERCENT_FN(overhead_sys, period_sys) |
52 | __HPP_COLOR_PERCENT_FN(overhead_us, period_us) | 66 | __HPP_COLOR_PERCENT_FN(overhead_us, period_us) |
53 | __HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys) | 67 | __HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys) |
54 | __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) | 68 | __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) |
69 | __HPP_COLOR_ACC_PERCENT_FN(overhead_acc, period) | ||
55 | 70 | ||
56 | #undef __HPP_COLOR_PERCENT_FN | 71 | #undef __HPP_COLOR_PERCENT_FN |
57 | 72 | ||
@@ -68,6 +83,8 @@ void perf_gtk__init_hpp(void) | |||
68 | perf_gtk__hpp_color_overhead_guest_sys; | 83 | perf_gtk__hpp_color_overhead_guest_sys; |
69 | perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color = | 84 | perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color = |
70 | perf_gtk__hpp_color_overhead_guest_us; | 85 | perf_gtk__hpp_color_overhead_guest_us; |
86 | perf_hpp__format[PERF_HPP__OVERHEAD_ACC].color = | ||
87 | perf_gtk__hpp_color_overhead_acc; | ||
71 | } | 88 | } |
72 | 89 | ||
73 | static void callchain_list__sym_name(struct callchain_list *cl, | 90 | static void callchain_list__sym_name(struct callchain_list *cl, |
@@ -181,6 +198,13 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
181 | if (perf_hpp__should_skip(fmt)) | 198 | if (perf_hpp__should_skip(fmt)) |
182 | continue; | 199 | continue; |
183 | 200 | ||
201 | /* | ||
202 | * XXX no way to determine where symcol column is.. | ||
203 | * Just use last column for now. | ||
204 | */ | ||
205 | if (perf_hpp__is_sort_entry(fmt)) | ||
206 | sym_col = col_idx; | ||
207 | |||
184 | fmt->header(fmt, &hpp, hists_to_evsel(hists)); | 208 | fmt->header(fmt, &hpp, hists_to_evsel(hists)); |
185 | 209 | ||
186 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), | 210 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), |
@@ -209,14 +233,12 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
209 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); | 233 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); |
210 | GtkTreeIter iter; | 234 | GtkTreeIter iter; |
211 | u64 total = hists__total_period(h->hists); | 235 | u64 total = hists__total_period(h->hists); |
212 | float percent = 0.0; | 236 | float percent; |
213 | 237 | ||
214 | if (h->filtered) | 238 | if (h->filtered) |
215 | continue; | 239 | continue; |
216 | 240 | ||
217 | if (total) | 241 | percent = hist_entry__get_percent_limit(h); |
218 | percent = h->stat.period * 100.0 / total; | ||
219 | |||
220 | if (percent < min_pcnt) | 242 | if (percent < min_pcnt) |
221 | continue; | 243 | continue; |
222 | 244 | ||
@@ -238,7 +260,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
238 | 260 | ||
239 | if (symbol_conf.use_callchain && sort__has_sym) { | 261 | if (symbol_conf.use_callchain && sort__has_sym) { |
240 | if (callchain_param.mode == CHAIN_GRAPH_REL) | 262 | if (callchain_param.mode == CHAIN_GRAPH_REL) |
241 | total = h->stat.period; | 263 | total = symbol_conf.cumulate_callchain ? |
264 | h->stat_acc->period : h->stat.period; | ||
242 | 265 | ||
243 | perf_gtk__add_callchain(&h->sorted_chain, store, &iter, | 266 | perf_gtk__add_callchain(&h->sorted_chain, store, &iter, |
244 | sym_col, total); | 267 | sym_col, total); |