diff --git a/ChangeLog b/ChangeLog index e42606eb..0df5fb15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-11-19 Soren Sandmann + + * 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. + Thu Nov 9 17:55:24 2006 Søren Sandmann * TODO (-): udpate diff --git a/TODO b/TODO index fb81e5c7..b1f3f306 100644 --- a/TODO +++ b/TODO @@ -203,7 +203,18 @@ Before 1.2: - plug all the leaks - loading and saving probably leak right now +- make it use less memory: + - StackNodes are dominating + - fold 'toplevel' into 'size' + - allocate in blocks + - this will need to be coordinated with + profile.c which also creates stacknodes. + + - maybe simply make stackstashes able to + save themselves. + - rethink loading and saving. Goals + - Can load 1.0 profiles - Don't export too much of stackstashes to the rest of the app diff --git a/binparser.h b/binparser.h index b4d4d332..7240149f 100644 --- a/binparser.h +++ b/binparser.h @@ -8,6 +8,7 @@ typedef struct BinRecord BinRecord; /* BinParser */ BinParser * bin_parser_new (const guchar *data, gsize length); +void bin_parser_free (BinParser *parser); const guchar *bin_parser_get_data (BinParser *parser); gsize bin_parser_get_length (BinParser *parser); gsize bin_parser_get_offset (BinParser *parser); diff --git a/elfparser.c b/elfparser.c index a07c10fe..a9ec0d1e 100644 --- a/elfparser.c +++ b/elfparser.c @@ -1,6 +1,7 @@ #include #include #include +#include #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; } diff --git a/process.c b/process.c index 5a4ca962..972f5f14 100644 --- a/process.c +++ b/process.c @@ -40,9 +40,6 @@ struct Map gulong end; gulong offset; gulong inode; -#if 0 - gboolean do_offset; -#endif BinFile * bin_file; }; @@ -50,14 +47,14 @@ struct Map struct Process { char * cmdline; - + int n_maps; Map * maps; GList * bad_pages; int pid; - + const char *undefined; }; diff --git a/sfile.c b/sfile.c index 7f45369b..ac23aef6 100644 --- a/sfile.c +++ b/sfile.c @@ -1,3 +1,5 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- */ + /* Sysprof -- Sampling, systemwide CPU profiler * Copyright 2004, Red Hat, Inc. * Copyright 2004, 2005, Soeren Sandmann @@ -17,8 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- */ - #include #include #include