aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2017-10-11 11:01:27 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-11-13 07:39:58 -0500
commit37236d5e0b6a765319dec3e64d828cb44ebecac6 (patch)
tree8d085e8cf65f12677f0d3cf11cde8278dfb31c1f /tools/perf/ui/browsers/annotate.c
parentd5490b9647e6e41b203186ed0d73b4103f139fda (diff)
perf annotate: Move ipc/cycles into annotation_line struct
Move ipc/cycles into annotation_line struct to be used as generic members for any annotation source. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20171011150158.11895-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r--tools/perf/ui/browsers/annotate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 73d921c3e3ec..d1aff2f7cb6c 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -144,7 +144,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
144 144
145 if ((row == 0) && (dl->al.offset == -1 || percent_max == 0.0)) { 145 if ((row == 0) && (dl->al.offset == -1 || percent_max == 0.0)) {
146 if (ab->have_cycles) { 146 if (ab->have_cycles) {
147 if (dl->ipc == 0.0 && dl->cycles == 0) 147 if (dl->al.ipc == 0.0 && dl->al.cycles == 0)
148 show_title = true; 148 show_title = true;
149 } else 149 } else
150 show_title = true; 150 show_title = true;
@@ -178,16 +178,16 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
178 } 178 }
179 } 179 }
180 if (ab->have_cycles) { 180 if (ab->have_cycles) {
181 if (dl->ipc) 181 if (dl->al.ipc)
182 ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc); 182 ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->al.ipc);
183 else if (!show_title) 183 else if (!show_title)
184 ui_browser__write_nstring(browser, " ", IPC_WIDTH); 184 ui_browser__write_nstring(browser, " ", IPC_WIDTH);
185 else 185 else
186 ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC"); 186 ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC");
187 187
188 if (dl->cycles) 188 if (dl->al.cycles)
189 ui_browser__printf(browser, "%*" PRIu64 " ", 189 ui_browser__printf(browser, "%*" PRIu64 " ",
190 CYCLES_WIDTH - 1, dl->cycles); 190 CYCLES_WIDTH - 1, dl->al.cycles);
191 else if (!show_title) 191 else if (!show_title)
192 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); 192 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
193 else 193 else
@@ -474,7 +474,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
474 max_percent = bpos->samples[i].percent; 474 max_percent = bpos->samples[i].percent;
475 } 475 }
476 476
477 if (max_percent < 0.01 && pos->ipc == 0) { 477 if (max_percent < 0.01 && pos->al.ipc == 0) {
478 RB_CLEAR_NODE(&bpos->rb_node); 478 RB_CLEAR_NODE(&bpos->rb_node);
479 continue; 479 continue;
480 } 480 }
@@ -994,7 +994,7 @@ static void count_and_fill(struct annotate_browser *browser, u64 start, u64 end,
994 struct disasm_line *dl = browser->offsets[offset]; 994 struct disasm_line *dl = browser->offsets[offset];
995 995
996 if (dl) 996 if (dl)
997 dl->ipc = ipc; 997 dl->al.ipc = ipc;
998 } 998 }
999 } 999 }
1000} 1000}
@@ -1025,7 +1025,7 @@ static void annotate__compute_ipc(struct annotate_browser *browser, size_t size,
1025 count_and_fill(browser, ch->start, offset, ch); 1025 count_and_fill(browser, ch->start, offset, ch);
1026 dl = browser->offsets[offset]; 1026 dl = browser->offsets[offset];
1027 if (dl && ch->num_aggr) 1027 if (dl && ch->num_aggr)
1028 dl->cycles = ch->cycles_aggr / ch->num_aggr; 1028 dl->al.cycles = ch->cycles_aggr / ch->num_aggr;
1029 browser->have_cycles = true; 1029 browser->have_cycles = true;
1030 } 1030 }
1031 } 1031 }