memstats.c File Reference

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 codelineget_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
 

Detailed Description

This program reads a log file and prints the memory allocation summed up.