mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Use an array instead of a list. Look for vmlinux in the source directory.
2007-10-22 Soren Sandmann <sandmann@daimi.au.dk> * process.c (look_for_vmlinux): Use an array instead of a list. Look for vmlinux in the source directory. * elfparser.c (elf_parser_get_crc32): Only use MADV_DONTNEED if the data is file-backed. * TODO: updates. Various formatting fixes svn path=/trunk/; revision=385
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
97076b7d0f
commit
1867b97a8d
21
elfparser.c
21
elfparser.c
@ -258,11 +258,7 @@ elf_parser_new (const char *filename,
|
||||
#if 0
|
||||
g_print ("Elf file: %s (debug: %s)\n",
|
||||
filename, elf_parser_get_debug_link (parser, NULL));
|
||||
#endif
|
||||
|
||||
parser->file = file;
|
||||
|
||||
#if 0
|
||||
if (!parser->symbols)
|
||||
g_print ("at this point %s has no symbols\n", filename);
|
||||
#endif
|
||||
@ -339,7 +335,8 @@ elf_parser_get_crc32 (ElfParser *parser)
|
||||
* We could be more exact here, but it's only a few minor
|
||||
* pagefaults.
|
||||
*/
|
||||
madvise ((char *)data, length, MADV_DONTNEED);
|
||||
if (parser->file)
|
||||
madvise ((char *)data, length, MADV_DONTNEED);
|
||||
|
||||
return ~crc & 0xffffffff;
|
||||
}
|
||||
@ -461,19 +458,23 @@ read_table (ElfParser *parser,
|
||||
parser->symbols[n_functions].address = addr;
|
||||
parser->symbols[n_functions].offset = offset;
|
||||
|
||||
n_functions++;
|
||||
|
||||
#if 0
|
||||
g_print (" symbol: %s: %d\n", get_string_indirect (parser->parser,
|
||||
g_print ("symbol: %s: %d\n", get_string_indirect (parser->parser,
|
||||
parser->sym_format, "st_name",
|
||||
str_table->offset), addr);
|
||||
#endif
|
||||
n_functions++;
|
||||
}
|
||||
#if 0
|
||||
g_print (" sym %d in %p (info: %d:%d) (func:global %d:%d)\n", addr, parser, info & 0xf, info >> 4, STT_FUNC, STB_GLOBAL);
|
||||
#endif
|
||||
}
|
||||
else if (addr != 0)
|
||||
{
|
||||
g_print ("rejecting %d in %p (info: %d:%d) (func:global %d:%d)\n", addr, parser, info & 0xf, info >> 4, STT_FUNC, STB_GLOBAL);
|
||||
}
|
||||
#if 0
|
||||
g_print (" rejecting %d in %p (info: %d:%d) (func:global %d:%d)\n", addr, parser, info & 0xf, info >> 4, STT_FUNC, STB_GLOBAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
bin_parser_seek_record (parser->parser, parser->sym_format, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user