如何禁用缓冲mtrace
并输出名称来自的文件MALLOC_TRACE
?
mtrace 启动为:
$ cat libmtrace1.c
#include <mcheck.h>
static __attribute__((constructor)) void mtrace_install(void) {
atexit(&muntrace);
mtrace();
}
$gcc libmtrace1.c -fPIC -shared -o libmtrace1.so
$LD_PRELOAD=./libmtrace1.so MALLOC_TRACE=mtrace_log /bin/ls