mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Declare bin_parser_free();
2006-11-19 Soren Sandmann <sandmann@redhat.com> * binparser.h: Declare bin_parser_free(); * elfparser.c (elf_parser_get_crc32): Use madvise(DONT_NEED) on the file. * process.c (struct Process): Remove do_offset.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
66fc976342
commit
9af533a11f
@ -1,6 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <elf.h>
|
||||
#include <sys/mman.h>
|
||||
#include "binparser.h"
|
||||
#include "elfparser.h"
|
||||
|
||||
@ -269,6 +270,14 @@ elf_parser_get_crc32 (ElfParser *parser)
|
||||
for (i = 0; i < length; ++i)
|
||||
crc = crc32_table[(crc ^ data[i]) & 0xff] ^ (crc >> 8);
|
||||
|
||||
/* We just read the entire file into memory, but we only really
|
||||
* need the symbol table, so swap the whole thing out.
|
||||
*
|
||||
* We could be more exact here, but it's only a few minor
|
||||
* pagefaults.
|
||||
*/
|
||||
madvise ((char *)data, length, MADV_DONTNEED);
|
||||
|
||||
return ~crc & 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user