diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 19bfcadcf89169..3a3916934a9290 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -1090,6 +1090,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node * { al->map = node->map; al->sym = node->sym; + al->srcline = node->srcline; if (node->map) al->addr = node->map->map_ip(node->map, node->ip); else diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 47eff4767edb47..3c411e7e36aa99 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -1604,6 +1604,7 @@ int machine__resolve(struct machine *machine, struct addr_location *al, al->sym = NULL; al->cpu = sample->cpu; al->socket = -1; + al->srcline = NULL; if (al->cpu >= 0) { struct perf_env *env = machine->env; diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index b0fa9c217e1c9e..25d143053ab57b 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -596,6 +596,7 @@ __hists__add_entry(struct hists *hists, .map = al->map, .sym = al->sym, }, + .srcline = al->srcline ? strdup(al->srcline) : NULL, .socket = al->socket, .cpu = al->cpu, .cpumode = al->cpumode, @@ -950,6 +951,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, .map = al->map, .sym = al->sym, }, + .srcline = al->srcline ? strdup(al->srcline) : NULL, .parent = iter->parent, .raw_data = sample->raw_data, .raw_size = sample->raw_size, diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index d880a059babbea..d548ea5cb418bd 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -209,6 +209,7 @@ struct addr_location { struct thread *thread; struct map *map; struct symbol *sym; + const char *srcline; u64 addr; char level; u8 filtered;