static bool disasm_line__filter(struct ui_browser *browser, void *entry)
{
struct annotation *notes = browser__annotation(browser);
-
- if (notes->options->hide_src_code) {
- struct annotation_line *al = list_entry(entry, struct annotation_line, node);
-
- return al->offset == -1;
- }
-
- return false;
+ struct annotation_line *al = list_entry(entry, struct annotation_line, node);
+ return annotation_line__filter(al, notes);
}
static int ui_browser__jumps_percent_color(struct ui_browser *browser, int nr, bool current)
static void annotate_browser__set_top(struct annotate_browser *browser,
struct annotation_line *pos, u32 idx)
{
+ struct annotation *notes = browser__annotation(&browser->b);
unsigned back;
ui_browser__refresh_dimensions(&browser->b);
while (browser->b.top_idx != 0 && back != 0) {
pos = list_entry(pos->node.prev, struct annotation_line, node);
- if (disasm_line__filter(&browser->b, &pos->node))
+ if (annotation_line__filter(pos, notes))
continue;
--browser->b.top_idx;
list_for_each_entry(pos, ¬es->src->source, al.node) {
if (pos->al.offset == offset)
return pos;
- if (!disasm_line__filter(&browser->b, &pos->al.node))
+ if (!annotation_line__filter(&pos->al, notes))
++*idx;
}
*idx = browser->b.index;
list_for_each_entry_continue(al, ¬es->src->source, node) {
- if (disasm_line__filter(&browser->b, &al->node))
+ if (annotation_line__filter(al, notes))
continue;
++*idx;
*idx = browser->b.index;
list_for_each_entry_continue_reverse(al, ¬es->src->source, node) {
- if (disasm_line__filter(&browser->b, &al->node))
+ if (annotation_line__filter(al, notes))
continue;
--*idx;
return (notes->options->show_total_period ? 12 : 7) * notes->nr_events;
}
+static inline bool annotation_line__filter(struct annotation_line *al, struct annotation *notes)
+{
+ return notes->options->hide_src_code && al->offset == -1;
+}
void annotation__set_offsets(struct annotation *notes, s64 size);
void annotation__compute_ipc(struct annotation *notes, size_t size);