These patches add a --enable-malloc-stats configure options, which will make qemu trace its memory allocations. A new monitor command dump-malloc-stats lets the user dump them to a file.
Using statistics with KVM depends on the patch I posted recently to use qemu_free consistently. However, there is no regression without the configure flag. Paolo Bonzini (2): malloc: move memalign/vmalloc to qemu-malloc.c malloc: add statistics infrastructure configure | 9 ++ hmp-commands.hx | 16 ++++ monitor.c | 12 +++ osdep.h | 5 +- oslib-posix.c | 32 ++------ oslib-win32.c | 31 +------- qemu-common.h | 46 +++++++++-- qemu-malloc.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++---- trace-events | 1 - 9 files changed, 316 insertions(+), 80 deletions(-) -- 1.7.4.4