perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node'
To ease passing around map+symbol, just like done for other parts of the tree recently. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -582,8 +582,8 @@ fill_node(struct callchain_node *node, struct callchain_cursor *cursor)
|
||||
return -1;
|
||||
}
|
||||
call->ip = cursor_node->ip;
|
||||
call->ms.sym = cursor_node->sym;
|
||||
call->ms.map = map__get(cursor_node->map);
|
||||
call->ms = cursor_node->ms;
|
||||
map__get(call->ms.map);
|
||||
call->srcline = cursor_node->srcline;
|
||||
|
||||
if (cursor_node->branch) {
|
||||
@@ -720,21 +720,21 @@ static enum match_result match_chain(struct callchain_cursor_node *node,
|
||||
/* otherwise fall-back to symbol-based comparison below */
|
||||
__fallthrough;
|
||||
case CCKEY_FUNCTION:
|
||||
if (node->sym && cnode->ms.sym) {
|
||||
if (node->ms.sym && cnode->ms.sym) {
|
||||
/*
|
||||
* Compare inlined frames based on their symbol name
|
||||
* because different inlined frames will have the same
|
||||
* symbol start. Otherwise do a faster comparison based
|
||||
* on the symbol start address.
|
||||
*/
|
||||
if (cnode->ms.sym->inlined || node->sym->inlined) {
|
||||
if (cnode->ms.sym->inlined || node->ms.sym->inlined) {
|
||||
match = match_chain_strings(cnode->ms.sym->name,
|
||||
node->sym->name);
|
||||
node->ms.sym->name);
|
||||
if (match != MATCH_ERROR)
|
||||
break;
|
||||
} else {
|
||||
match = match_chain_dso_addresses(cnode->ms.map, cnode->ms.sym->start,
|
||||
node->map, node->sym->start);
|
||||
node->ms.map, node->ms.sym->start);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -742,7 +742,7 @@ static enum match_result match_chain(struct callchain_cursor_node *node,
|
||||
__fallthrough;
|
||||
case CCKEY_ADDRESS:
|
||||
default:
|
||||
match = match_chain_dso_addresses(cnode->ms.map, cnode->ip, node->map, node->ip);
|
||||
match = match_chain_dso_addresses(cnode->ms.map, cnode->ip, node->ms.map, node->ip);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1004,8 +1004,7 @@ merge_chain_branch(struct callchain_cursor *cursor,
|
||||
int err = 0;
|
||||
|
||||
list_for_each_entry_safe(list, next_list, &src->val, list) {
|
||||
callchain_cursor_append(cursor, list->ip,
|
||||
list->ms.map, list->ms.sym,
|
||||
callchain_cursor_append(cursor, list->ip, &list->ms,
|
||||
false, NULL, 0, 0, 0, list->srcline);
|
||||
list_del_init(&list->list);
|
||||
map__zput(list->ms.map);
|
||||
@@ -1044,7 +1043,7 @@ int callchain_merge(struct callchain_cursor *cursor,
|
||||
}
|
||||
|
||||
int callchain_cursor_append(struct callchain_cursor *cursor,
|
||||
u64 ip, struct map *map, struct symbol *sym,
|
||||
u64 ip, struct map_symbol *ms,
|
||||
bool branch, struct branch_flags *flags,
|
||||
int nr_loop_iter, u64 iter_cycles, u64 branch_from,
|
||||
const char *srcline)
|
||||
@@ -1060,9 +1059,9 @@ int callchain_cursor_append(struct callchain_cursor *cursor,
|
||||
}
|
||||
|
||||
node->ip = ip;
|
||||
map__zput(node->map);
|
||||
node->map = map__get(map);
|
||||
node->sym = sym;
|
||||
map__zput(node->ms.map);
|
||||
node->ms = *ms;
|
||||
map__get(node->ms.map);
|
||||
node->branch = branch;
|
||||
node->nr_loop_iter = nr_loop_iter;
|
||||
node->iter_cycles = iter_cycles;
|
||||
@@ -1107,8 +1106,8 @@ int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *samp
|
||||
int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *node,
|
||||
bool hide_unresolved)
|
||||
{
|
||||
al->map = node->map;
|
||||
al->sym = node->sym;
|
||||
al->map = node->ms.map;
|
||||
al->sym = node->ms.sym;
|
||||
al->srcline = node->srcline;
|
||||
al->addr = node->ip;
|
||||
|
||||
@@ -1571,7 +1570,7 @@ int callchain_cursor__copy(struct callchain_cursor *dst,
|
||||
if (node == NULL)
|
||||
break;
|
||||
|
||||
rc = callchain_cursor_append(dst, node->ip, node->map, node->sym,
|
||||
rc = callchain_cursor_append(dst, node->ip, &node->ms,
|
||||
node->branch, &node->branch_flags,
|
||||
node->nr_loop_iter,
|
||||
node->iter_cycles,
|
||||
@@ -1597,5 +1596,5 @@ void callchain_cursor_reset(struct callchain_cursor *cursor)
|
||||
cursor->last = &cursor->first;
|
||||
|
||||
for (node = cursor->first; node != NULL; node = node->next)
|
||||
map__zput(node->map);
|
||||
map__zput(node->ms.map);
|
||||
}
|
||||
|
Reference in New Issue
Block a user