mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-08 22:20:54 +00:00
Add commented out code to reject callback.
2008-02-17 Soren Sandmann <sandmann@redhat.com> * collector.c (lookup_symbol): Add commented out code to reject callback. * elfparser.c (struct ElfParser): Store the filename if any (elf_parser_get_sym_address): Subtract the load address, so the result will be an offset into the text section. * process.[ch] (process_lookup_symbol): Add an offset out-argument * binfile.[ch] (bin_symbol_get_address): New function * TODO: updates svn path=/trunk/; revision=397
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
9d2f7a1a9d
commit
b98db05f9b
26
collector.c
26
collector.c
@ -383,7 +383,7 @@ static char *
|
||||
lookup_symbol (Process *process, gpointer address,
|
||||
GHashTable *unique_symbols,
|
||||
gboolean kernel,
|
||||
gboolean first_kernel_addr)
|
||||
gboolean first_addr)
|
||||
{
|
||||
const char *sym;
|
||||
|
||||
@ -396,11 +396,11 @@ lookup_symbol (Process *process, gpointer address,
|
||||
|
||||
/* If offset is 0, it is a callback, not a return address.
|
||||
*
|
||||
* If "first_kernel_addr" is true, then the address is an
|
||||
* If "first_addr" is true, then the address is an
|
||||
* instruction pointer, not a return address, so it may
|
||||
* legitimately be at offset 0.
|
||||
*/
|
||||
if (offset == 0 && !first_kernel_addr)
|
||||
if (offset == 0 && !first_addr)
|
||||
sym = NULL;
|
||||
|
||||
/* If offset is greater than 4096, then what happened is most
|
||||
@ -416,7 +416,19 @@ lookup_symbol (Process *process, gpointer address,
|
||||
}
|
||||
else
|
||||
{
|
||||
sym = process_lookup_symbol (process, (gulong)address);
|
||||
gulong offset;
|
||||
|
||||
sym = process_lookup_symbol (process, (gulong)address, &offset);
|
||||
|
||||
if (offset == 0 && !first_addr)
|
||||
{
|
||||
#if 0
|
||||
sym = g_strdup_printf ("%s [callback]", sym);
|
||||
g_print ("rejecting %s since it looks like a callback\n",
|
||||
sym);
|
||||
sym = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (sym)
|
||||
@ -435,7 +447,7 @@ resolve_symbols (GList *trace, gint size, gpointer data)
|
||||
GPtrArray *resolved_trace = g_ptr_array_new ();
|
||||
char *cmdline;
|
||||
gboolean in_kernel = FALSE;
|
||||
gboolean first_kernel_addr = TRUE;
|
||||
gboolean first_addr = TRUE;
|
||||
|
||||
for (list = trace; list && list->next; list = list->next)
|
||||
{
|
||||
@ -452,8 +464,8 @@ resolve_symbols (GList *trace, gint size, gpointer data)
|
||||
in_kernel = FALSE;
|
||||
|
||||
symbol = lookup_symbol (process, address, info->unique_symbols,
|
||||
in_kernel, first_kernel_addr);
|
||||
first_kernel_addr = FALSE;
|
||||
in_kernel, first_addr);
|
||||
first_addr = FALSE;
|
||||
|
||||
if (symbol)
|
||||
g_ptr_array_add (resolved_trace, symbol);
|
||||
|
||||
Reference in New Issue
Block a user