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.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 1e764a8ad259..6f259b3d14e2 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -32,21 +32,18 @@ static int __hpp__color_fmt(struct perf_hpp *hpp, struct hist_entry *he,
32 int ret; 32 int ret;
33 double percent = 0.0; 33 double percent = 0.0;
34 struct hists *hists = he->hists; 34 struct hists *hists = he->hists;
35 struct perf_evsel *evsel = hists_to_evsel(hists);
35 36
36 if (hists->stats.total_period) 37 if (hists->stats.total_period)
37 percent = 100.0 * get_field(he) / hists->stats.total_period; 38 percent = 100.0 * get_field(he) / hists->stats.total_period;
38 39
39 ret = __percent_color_snprintf(hpp->buf, hpp->size, percent); 40 ret = __percent_color_snprintf(hpp->buf, hpp->size, percent);
40 41
41 if (symbol_conf.event_group) { 42 if (perf_evsel__is_group_event(evsel)) {
42 int prev_idx, idx_delta; 43 int prev_idx, idx_delta;
43 struct perf_evsel *evsel = hists_to_evsel(hists);
44 struct hist_entry *pair; 44 struct hist_entry *pair;
45 int nr_members = evsel->nr_members; 45 int nr_members = evsel->nr_members;
46 46
47 if (nr_members <= 1)
48 return ret;
49
50 prev_idx = perf_evsel__group_idx(evsel); 47 prev_idx = perf_evsel__group_idx(evsel);
51 48
52 list_for_each_entry(pair, &he->pairs.head, pairs.node) { 49 list_for_each_entry(pair, &he->pairs.head, pairs.node) {