perf symbols: Provide libtraceevent callback to resolve kernel symbols
That provides the function signature expected by libtraceevent's pevent_set_function_resolver(). Acked-by: David Ahern <dsahern@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-ie6hvlb6u15y4ulg9j1612zg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1993,3 +1993,17 @@ struct dso *machine__findnew_dso(struct machine *machine, const char *filename)
|
||||
{
|
||||
return dsos__findnew(&machine->dsos, filename);
|
||||
}
|
||||
|
||||
char *machine__resolve_kernel_addr(void *vmachine, unsigned long long *addrp, char **modp)
|
||||
{
|
||||
struct machine *machine = vmachine;
|
||||
struct map *map;
|
||||
struct symbol *sym = map_groups__find_symbol(&machine->kmaps, MAP__FUNCTION, *addrp, &map, NULL);
|
||||
|
||||
if (sym == NULL)
|
||||
return NULL;
|
||||
|
||||
*modp = __map__is_kmodule(map) ? (char *)map->dso->short_name : NULL;
|
||||
*addrp = map->unmap_ip(map, sym->start);
|
||||
return sym->name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user