|
unbound 0.1
|
This program reads a log file and prints the memory allocation summed up. More...
#include "config.h"#include "util/log.h"#include "util/rbtree.h"#include "util/locks.h"#include "util/fptr_wlist.h"#include <sys/stat.h>Data Structures | |
| struct | codeline |
| The allocation statistics block. More... | |
Functions | |
| static void | usage (void) |
| print usage and exit | |
| static int | match (char *line) |
| match logfile line to see if it needs accounting processing | |
| static struct codeline * | get_codeline (rbtree_type *tree, char *key, char *func) |
| find or alloc codeline in tree | |
| static void | read_malloc_stat (char *line, rbtree_type *tree) |
| read up the malloc stats | |
| static void | read_calloc_stat (char *line, rbtree_type *tree) |
| read up the calloc stats | |
| static off_t | get_file_size (const char *fname) |
| get size of file | |
| static void | readfile (rbtree_type *tree, const char *fname) |
| read the logfile | |
| static void | printstats (rbtree_type *tree) |
| print memory stats | |
| int | main (int argc, const char *argv[]) |
| main program | |
This program reads a log file and prints the memory allocation summed up.
|
static |
print usage and exit
References usage().
|
static |
match logfile line to see if it needs accounting processing
Referenced by readfile().
|
static |
find or alloc codeline in tree
References codeline::alloc, codeline::codeline, codeline::free, codeline::func, get_codeline(), rbnode_type::key, codeline::node, rbtree_insert(), and rbtree_search().
Referenced by get_codeline(), read_calloc_stat(), and read_malloc_stat().
|
static |
read up the malloc stats
References codeline::alloc, codeline::calls, fatal_exit(), get_codeline(), and read_malloc_stat().
Referenced by read_malloc_stat(), and readfile().
|
static |
read up the calloc stats
References codeline::alloc, codeline::calls, fatal_exit(), get_codeline(), and read_calloc_stat().
Referenced by read_calloc_stat(), and readfile().
|
static |
get size of file
References fatal_exit(), and get_file_size().
Referenced by get_file_size(), and readfile().
|
static |
read the logfile
References fatal_exit(), get_file_size(), match(), read_calloc_stat(), read_malloc_stat(), and readfile().
Referenced by main(), and readfile().
|
static |
print memory stats
References codeline::alloc, codeline::calls, codeline::codeline, rbtree_type::count, codeline::func, printstats(), and RBTREE_FOR.
Referenced by main(), and printstats().
| int main | ( | int | argc, |
| const char * | argv[] ) |
main program
References fatal_exit(), log_init(), main, printstats(), rbtree_create(), readfile(), and usage().