Newer
Older
size_t disasm__fprintf(struct list_head *head, FILE *fp)
{
struct disasm_line *pos;
size_t printed = 0;
list_for_each_entry(pos, head, node)
printed += disasm_line__fprintf(pos, fp);
return printed;
}

Arnaldo Carvalho de Melo
committed
int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx,
bool print_lines, bool full_paths, int min_pcnt,
int max_lines)
{
struct dso *dso = map->dso;
const char *filename = dso->long_name;
struct rb_root source_line = RB_ROOT;
u64 len;
if (symbol__annotate(sym, map, 0) < 0)

Arnaldo Carvalho de Melo
committed
return -1;
len = symbol__size(sym);

Arnaldo Carvalho de Melo
committed
if (print_lines) {
symbol__get_source_line(sym, map, evidx, &source_line,
len, filename);
print_summary(&source_line, filename);
symbol__annotate_printf(sym, map, evidx, full_paths,
min_pcnt, max_lines, 0);
if (print_lines)
symbol__free_source_line(sym, len);
disasm__purge(&symbol__annotation(sym)->src->source);

Arnaldo Carvalho de Melo
committed
return 0;
}