aboutsummaryrefslogtreecommitdiff
path: root/malloc/mtrace-ctl.c
AgeCommit message (Collapse)AuthorFilesLines
2016-07-12Update to new binary file-based trace file.DJ Delorie1-19/+82
In order to not lose records, or need to guess ahead of time how many records you need, this switches to a mmap'd file for the trace buffer, and grows it as needed. The trace2dat perl script is replaced with a trace2wl C++ program that runs a lot faster and can handle the binary format.
2016-06-30Build fixes for in-tree and 32/64-bitDJ Delorie1-6/+19
Expand the comments in mtrace-ctl.c to better explain how to use this tracing controller. The new docs assume the SO is built and installed. Build fixed for trace_run.c Additional build pedantry to let trace_run.c be built with more warnings/errors turned on. Build/install trace_run and trace2dat trace2dat takes dump files from mtrace-ctl.so and turns them into mmap'able data files for trace_run, which "plays back" the logged calls. 32-bit compatibility Redesign tcache macros to account for differences between 64 and 32 bit systems.
2016-05-12Add libmtracectl.soDJ Delorie1-7/+7
Update Makefiles to build libmtracectl.so Tweak mtrace-ctl.c to avoid compiler warnings.
2016-03-17Replace int with size_t as appropriateDJ Delorie1-6/+10
2016-02-19More trace hooksDJ Delorie1-9/+11
Add hooks to pvalloc and calloc Add path flag for when a call is handled via a hook function
2016-02-11Update malloc tracing utility.DJ Delorie1-9/+53
Change head pointer to be total calls; adjust users to modulo after incrementing. Use mmap() instead of sbrk(). Split environment variables so count and file can be specified. Export trace hooks so mtrace-ctl can be built against libc.so. Allow NULL to be passed to __mtrace_get_trace_buffer. Add some error handling to mtrace-ctl.
2016-02-09Initial tracing functionalityDJ Delorie1-0/+69
First attempt at a low-overhead tracing feature. To enable, you build mtrace-ctl.c into a .so and LD_PRELOAD it. That uses a private API to set up a trace buffer, and calls to malloc et all fill in records in the trace buffer. At program exit, mtrace-ctl reads the buffer and stores the data on disk. Internally, the only contention point is the atomic update of the buffer head pointer. Once aquired, each thread fills in its record without needing locks.