mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
elf: only resolve addresses in none/user address context
This ensures that we only try to resolve addresses for ELFs when we know we're inside of the userspace address context.
This commit is contained in:
@ -250,11 +250,12 @@ guess_tag (SpElfSymbolResolver *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
sp_elf_symbol_resolver_resolve (SpSymbolResolver *resolver,
|
sp_elf_symbol_resolver_resolve_with_context (SpSymbolResolver *resolver,
|
||||||
guint64 time,
|
guint64 time,
|
||||||
GPid pid,
|
GPid pid,
|
||||||
SpCaptureAddress address,
|
SpAddressContext context,
|
||||||
GQuark *tag)
|
SpCaptureAddress address,
|
||||||
|
GQuark *tag)
|
||||||
{
|
{
|
||||||
SpElfSymbolResolver *self = (SpElfSymbolResolver *)resolver;
|
SpElfSymbolResolver *self = (SpElfSymbolResolver *)resolver;
|
||||||
const bin_symbol_t *bin_sym;
|
const bin_symbol_t *bin_sym;
|
||||||
@ -265,6 +266,9 @@ sp_elf_symbol_resolver_resolve (SpSymbolResolver *resolver,
|
|||||||
|
|
||||||
g_assert (SP_IS_ELF_SYMBOL_RESOLVER (self));
|
g_assert (SP_IS_ELF_SYMBOL_RESOLVER (self));
|
||||||
|
|
||||||
|
if (context != SP_ADDRESS_CONTEXT_USER && context != SP_ADDRESS_CONTEXT_NONE)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
lookaside = g_hash_table_lookup (self->lookasides, GINT_TO_POINTER (pid));
|
lookaside = g_hash_table_lookup (self->lookasides, GINT_TO_POINTER (pid));
|
||||||
if (lookaside == NULL)
|
if (lookaside == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -296,7 +300,7 @@ static void
|
|||||||
symbol_resolver_iface_init (SpSymbolResolverInterface *iface)
|
symbol_resolver_iface_init (SpSymbolResolverInterface *iface)
|
||||||
{
|
{
|
||||||
iface->load = sp_elf_symbol_resolver_load;
|
iface->load = sp_elf_symbol_resolver_load;
|
||||||
iface->resolve = sp_elf_symbol_resolver_resolve;
|
iface->resolve_with_context = sp_elf_symbol_resolver_resolve_with_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpSymbolResolver *
|
SpSymbolResolver *
|
||||||
|
|||||||
Reference in New Issue
Block a user