提交 ec03a77d 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

perf annotate browser: Use struct annotation_line in browser top

Use struct annotation_line in browser::b::top.
Signed-off-by: NJiri 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-34-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9213afbd
...@@ -390,7 +390,7 @@ static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line ...@@ -390,7 +390,7 @@ static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line
} }
static void annotate_browser__set_top(struct annotate_browser *browser, static void annotate_browser__set_top(struct annotate_browser *browser,
struct disasm_line *pos, u32 idx) struct annotation_line *pos, u32 idx)
{ {
unsigned back; unsigned back;
...@@ -399,16 +399,16 @@ static void annotate_browser__set_top(struct annotate_browser *browser, ...@@ -399,16 +399,16 @@ static void annotate_browser__set_top(struct annotate_browser *browser,
browser->b.top_idx = browser->b.index = idx; browser->b.top_idx = browser->b.index = idx;
while (browser->b.top_idx != 0 && back != 0) { while (browser->b.top_idx != 0 && back != 0) {
pos = list_entry(pos->al.node.prev, struct disasm_line, al.node); pos = list_entry(pos->node.prev, struct annotation_line, node);
if (disasm_line__filter(&browser->b, &pos->al.node)) if (disasm_line__filter(&browser->b, &pos->node))
continue; continue;
--browser->b.top_idx; --browser->b.top_idx;
--back; --back;
} }
browser->b.top = &pos->al; browser->b.top = pos;
browser->b.navkeypressed = true; browser->b.navkeypressed = true;
} }
...@@ -416,11 +416,11 @@ static void annotate_browser__set_rb_top(struct annotate_browser *browser, ...@@ -416,11 +416,11 @@ static void annotate_browser__set_rb_top(struct annotate_browser *browser,
struct rb_node *nd) struct rb_node *nd)
{ {
struct browser_line *bpos; struct browser_line *bpos;
struct disasm_line *pos; struct annotation_line *pos;
u32 idx; u32 idx;
pos = rb_entry(nd, struct disasm_line, al.rb_node); pos = rb_entry(nd, struct annotation_line, rb_node);
bpos = browser_line(&pos->al); bpos = browser_line(pos);
idx = bpos->idx; idx = bpos->idx;
if (annotate_browser__opts.hide_src_code) if (annotate_browser__opts.hide_src_code)
...@@ -472,13 +472,13 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -472,13 +472,13 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
static bool annotate_browser__toggle_source(struct annotate_browser *browser) static bool annotate_browser__toggle_source(struct annotate_browser *browser)
{ {
struct disasm_line *dl; struct annotation_line *al;
struct browser_line *bl; struct browser_line *bl;
off_t offset = browser->b.index - browser->b.top_idx; off_t offset = browser->b.index - browser->b.top_idx;
browser->b.seek(&browser->b, offset, SEEK_CUR); browser->b.seek(&browser->b, offset, SEEK_CUR);
dl = list_entry(browser->b.top, struct disasm_line, al.node); al = list_entry(browser->b.top, struct annotation_line, node);
bl = browser_line(&dl->al); bl = browser_line(al);
if (annotate_browser__opts.hide_src_code) { if (annotate_browser__opts.hide_src_code) {
if (bl->idx_asm < offset) if (bl->idx_asm < offset)
...@@ -600,7 +600,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser) ...@@ -600,7 +600,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser)
return true; return true;
} }
annotate_browser__set_top(browser, dl, idx); annotate_browser__set_top(browser, &dl->al, idx);
return true; return true;
} }
...@@ -639,7 +639,7 @@ static bool __annotate_browser__search(struct annotate_browser *browser) ...@@ -639,7 +639,7 @@ static bool __annotate_browser__search(struct annotate_browser *browser)
return false; return false;
} }
annotate_browser__set_top(browser, disasm_line(al), idx); annotate_browser__set_top(browser, al, idx);
browser->searching_backwards = false; browser->searching_backwards = false;
return true; return true;
} }
...@@ -678,7 +678,7 @@ static bool __annotate_browser__search_reverse(struct annotate_browser *browser) ...@@ -678,7 +678,7 @@ static bool __annotate_browser__search_reverse(struct annotate_browser *browser)
return false; return false;
} }
annotate_browser__set_top(browser, disasm_line(al), idx); annotate_browser__set_top(browser, al, idx);
browser->searching_backwards = true; browser->searching_backwards = true;
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册