8000 GitHub - m3m0m2/libmtrace
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

m3m0m2/libmtrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libmtrace

Summary

Libmtrace is an experimantal project to trace all memory allocation, reallocations and deallocations of a linux applications that uses libc. A backtrace is provided for every memory allocation (exception for initial bootstrap). Most calls at the very beginning and end are typically underlying libc allocation and can be ignored. Thread ID is also shown.

Author

Build

Requires GCC:

  make

Usage

To see expressive backtrace symbols the application to be inspected should be compiled using -rdynamic, for example:

  g++ test.cpp -o test -lpthread -rdynamic

This can then inspected as:

MTRACE_OUT=/dev/stdout LD_PRELOAD=./libmtrace.so ./test

LD_PRELOAD=./libmtrace.so /bin/pwd

If MTRACE_OUT is not specified the trace output will go to stderr.

Notes

Very little testing currently done.

Initial idea taken from: https://stackoverflow.com/questions/6083337/overriding-malloc-using-the-ld-preload-mechanism

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0