Commit 37236d5e authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d5490b96
...@@ -144,7 +144,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int ...@@ -144,7 +144,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
if ((row == 0) && (dl->al.offset == -1 || percent_max == 0.0)) { if ((row == 0) && (dl->al.offset == -1 || percent_max == 0.0)) {
if (ab->have_cycles) { if (ab->have_cycles) {
if (dl->ipc == 0.0 && dl->cycles == 0) if (dl->al.ipc == 0.0 && dl->al.cycles == 0)
show_title = true; show_title = true;
} else } else
show_title = true; show_title = true;
...@@ -178,16 +178,16 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int ...@@ -178,16 +178,16 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
} }
} }
if (ab->have_cycles) { if (ab->have_cycles) {
if (dl->ipc) if (dl->al.ipc)
ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc); ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->al.ipc);
else if (!show_title) else if (!show_title)
ui_browser__write_nstring(browser, " ", IPC_WIDTH); ui_browser__write_nstring(browser, " ", IPC_WIDTH);
else else
ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC"); ui_browser__printf(browser, "%*s ", IPC_WIDTH - 1, "IPC");
if (dl->cycles) if (dl->al.cycles)
ui_browser__printf(browser, "%*" PRIu64 " ", ui_browser__printf(browser, "%*" PRIu64 " ",
CYCLES_WIDTH - 1, dl->cycles); CYCLES_WIDTH - 1, dl->al.cycles);
else if (!show_title) else if (!show_title)
ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
else else
...@@ -474,7 +474,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -474,7 +474,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
max_percent = bpos->samples[i].percent; max_percent = bpos->samples[i].percent;
} }
if (max_percent < 0.01 && pos->ipc == 0) { if (max_percent < 0.01 && pos->al.ipc == 0) {
RB_CLEAR_NODE(&bpos->rb_node); RB_CLEAR_NODE(&bpos->rb_node);
continue; continue;
} }
...@@ -994,7 +994,7 @@ static void count_and_fill(struct annotate_browser *browser, u64 start, u64 end, ...@@ -994,7 +994,7 @@ static void count_and_fill(struct annotate_browser *browser, u64 start, u64 end,
struct disasm_line *dl = browser->offsets[offset]; struct disasm_line *dl = browser->offsets[offset];
if (dl) if (dl)
dl->ipc = ipc; dl->al.ipc = ipc;
} }
} }
} }
...@@ -1025,7 +1025,7 @@ static void annotate__compute_ipc(struct annotate_browser *browser, size_t size, ...@@ -1025,7 +1025,7 @@ static void annotate__compute_ipc(struct annotate_browser *browser, size_t size,
count_and_fill(browser, ch->start, offset, ch); count_and_fill(browser, ch->start, offset, ch);
dl = browser->offsets[offset]; dl = browser->offsets[offset];
if (dl && ch->num_aggr) if (dl && ch->num_aggr)
dl->cycles = ch->cycles_aggr / ch->num_aggr; dl->al.cycles = ch->cycles_aggr / ch->num_aggr;
browser->have_cycles = true; browser->have_cycles = true;
} }
} }
......
...@@ -64,13 +64,13 @@ struct annotation_line { ...@@ -64,13 +64,13 @@ struct annotation_line {
s64 offset; s64 offset;
char *line; char *line;
int line_nr; int line_nr;
float ipc;
u64 cycles;
}; };
struct disasm_line { struct disasm_line {
struct annotation_line al; struct annotation_line al;
struct ins ins; struct ins ins;
float ipc;
u64 cycles;
struct ins_operands ops; struct ins_operands ops;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment