Commit graph

7 commits

Author SHA1 Message Date
Behdad Esfahbod
e63d725ad4 [utils] Remove unused code 2009-08-10 12:47:37 -04:00
Behdad Esfahbod
d63c1ab3ff [util/malloc-stats] Do a single backtrace_symbols() call
I was hoping that this may speed things up, but it didn't.  :(
2009-01-31 22:10:57 -05:00
Behdad Esfahbod
64d1c75870 [util] Fix memset bug in malloc-stats 2009-01-31 21:34:46 -05:00
Chris Wilson
dd11d905a5 [util] Use a hash-table for malloc-stats.
At Behdad's request, convert the array of allocators into a simple hash
table (large static number of buckets + chaining) in order to speed up
malloc profiling.
2009-01-30 10:18:15 +00:00
Behdad Esfahbod
78dac47399 [util/malloc-stats.c] Add a public function malloc_stats()
Apparently glibc already provides the function:

  void malloc_stats (void);

So, like we do for backtrace_symbols(), override the public symbol.
It still is defined as __destructor__ and runs at program finalization.
2007-12-10 14:38:48 -05:00
Behdad Esfahbod
4cce3135e0 Clear executable flag off .c file 2007-07-26 18:04:39 -04:00
Behdad Esfahbod
3b46e105bd [util] Import my malloc wrapper that prints simple statistics
To build, do:

	make malloc-stats.so

inside util/, and to use, run:

	LD_PRELOAD=malloc-stats.so some-program

For binaries managed by libtool, eg, cairo-perf, do:

	../libtool --mode=execute /bin/true ./cairo-perf
	LD_PRELOAD="../util/malloc-stats.so" .libs/lt-cairo-perf

The code also includes Jeff Muizelaar's libbacktracesymbols that
is a much better implementation of backtrace_symbols() than what
is provided by glibc.  That can be built by:

	make backtrace-symbols.so
2007-04-21 08:23:15 -04:00