|
@@ -1189,6 +1189,18 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start,
|
|
|
|
+ struct perf_evsel *evsel, u64 len, int min_pcnt, int printed,
|
|
|
|
+ int max_lines, struct annotation_line *aq)
|
|
|
|
+{
|
|
|
|
+ struct disasm_line *dl = container_of(al, struct disasm_line, al);
|
|
|
|
+ struct disasm_line *queue = container_of(aq, struct disasm_line, al);
|
|
|
|
+
|
|
|
|
+ return disasm_line__print(dl, sym, start, evsel, len, min_pcnt, printed,
|
|
|
|
+ max_lines, queue);
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* symbol__parse_objdump_line() parses objdump output (with -d --no-show-raw)
|
|
* symbol__parse_objdump_line() parses objdump output (with -d --no-show-raw)
|
|
* which looks like following
|
|
* which looks like following
|
|
@@ -1797,7 +1809,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
|
|
const char *evsel_name = perf_evsel__name(evsel);
|
|
const char *evsel_name = perf_evsel__name(evsel);
|
|
struct annotation *notes = symbol__annotation(sym);
|
|
struct annotation *notes = symbol__annotation(sym);
|
|
struct sym_hist *h = annotation__histogram(notes, evsel->idx);
|
|
struct sym_hist *h = annotation__histogram(notes, evsel->idx);
|
|
- struct disasm_line *pos, *queue = NULL;
|
|
|
|
|
|
+ struct annotation_line *pos, *queue = NULL;
|
|
u64 start = map__rip_2objdump(map, sym->start);
|
|
u64 start = map__rip_2objdump(map, sym->start);
|
|
int printed = 2, queue_len = 0;
|
|
int printed = 2, queue_len = 0;
|
|
int more = 0;
|
|
int more = 0;
|
|
@@ -1830,15 +1842,19 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
|
|
if (verbose > 0)
|
|
if (verbose > 0)
|
|
symbol__annotate_hits(sym, evsel);
|
|
symbol__annotate_hits(sym, evsel);
|
|
|
|
|
|
- list_for_each_entry(pos, ¬es->src->source, al.node) {
|
|
|
|
|
|
+ list_for_each_entry(pos, ¬es->src->source, node) {
|
|
|
|
+ int err;
|
|
|
|
+
|
|
if (context && queue == NULL) {
|
|
if (context && queue == NULL) {
|
|
queue = pos;
|
|
queue = pos;
|
|
queue_len = 0;
|
|
queue_len = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- switch (disasm_line__print(pos, sym, start, evsel, len,
|
|
|
|
- min_pcnt, printed, max_lines,
|
|
|
|
- queue)) {
|
|
|
|
|
|
+ err = annotation_line__print(pos, sym, start, evsel, len,
|
|
|
|
+ min_pcnt, printed, max_lines,
|
|
|
|
+ queue);
|
|
|
|
+
|
|
|
|
+ switch (err) {
|
|
case 0:
|
|
case 0:
|
|
++printed;
|
|
++printed;
|
|
if (context) {
|
|
if (context) {
|
|
@@ -1860,7 +1876,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
|
|
if (!context)
|
|
if (!context)
|
|
break;
|
|
break;
|
|
if (queue_len == context)
|
|
if (queue_len == context)
|
|
- queue = list_entry(queue->al.node.next, typeof(*queue), al.node);
|
|
|
|
|
|
+ queue = list_entry(queue->node.next, typeof(*queue), node);
|
|
else
|
|
else
|
|
++queue_len;
|
|
++queue_len;
|
|
break;
|
|
break;
|