aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/gtk/hists.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui/gtk/hists.c')
-rw-r--r--tools/perf/ui/gtk/hists.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index e395ef9b0ae0..91f10f3f6dd1 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -228,12 +228,15 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
228 for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) { 228 for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) {
229 struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); 229 struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
230 GtkTreeIter iter; 230 GtkTreeIter iter;
231 float percent = h->stat.period * 100.0 / 231 u64 total = hists__total_period(h->hists);
232 hists->stats.total_period; 232 float percent = 0.0;
233 233
234 if (h->filtered) 234 if (h->filtered)
235 continue; 235 continue;
236 236
237 if (total)
238 percent = h->stat.period * 100.0 / total;
239
237 if (percent < min_pcnt) 240 if (percent < min_pcnt)
238 continue; 241 continue;
239 242
@@ -261,12 +264,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
261 } 264 }
262 265
263 if (symbol_conf.use_callchain && sort__has_sym) { 266 if (symbol_conf.use_callchain && sort__has_sym) {
264 u64 total;
265
266 if (callchain_param.mode == CHAIN_GRAPH_REL) 267 if (callchain_param.mode == CHAIN_GRAPH_REL)
267 total = h->stat.period; 268 total = h->stat.period;
268 else
269 total = hists->stats.total_period;
270 269
271 perf_gtk__add_callchain(&h->sorted_chain, store, &iter, 270 perf_gtk__add_callchain(&h->sorted_chain, store, &iter,
272 sym_col, total); 271 sym_col, total);