log-malloc is a logger tool that logs malloc and free operations in a simple manner.
The log-malloc project provides you with the functionality to log parameters, return values, and the call stack. One of the biggest advantages of this software is that you don't need to rebuild your application that needs to be logged.
To install log-malloc, all you need to do is run this command to build it: "gcc -nostartfiles –shared -fPIC -g -ldl -o log-malloc.so log-malloc.c". After installation, usage is simple. To run the software, use this command: "LD_PRELOAD=./log-malloc.so command args …". Additionally, if you want to redirect output to a file, simply run: "LD_PRELOAD=./log-malloc.so command args … 200>filename".
The software is also versatile in the sense that you can convert 0x addresses into source code line numbers by utilizing the addr2line tool in GNU binutils.
In the latest release of log-malloc, the developers have included thread-safe stack traversal and optional pthread locks, making it even more useful for developers. All in all, log-malloc is an excellent software tool for any software developer looking for a simple and effective way to log malloc/free operations.
Version 2007-06-01: N/A