diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-09-16 17:38:44 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-10-09 10:14:05 +0100 |
commit | 98cf48f60aa4999f5b2808569a193a401a390e6a (patch) | |
tree | 803cdc2c76fb3e7a3bf4d8d4d09353cd2e072435 /vl.c | |
parent | 2e4ccbbc64b212c4d1c7008ca58e141d6a984494 (diff) | |
download | qemu-98cf48f60aa4999f5b2808569a193a401a390e6a.zip |
trace: remove malloc tracing
The malloc vtable is not supported anymore in glib, because it broke
when constructors called g_malloc. Remove tracing of g_malloc,
g_realloc and g_free calls.
Note that, for systemtap users, glib also provides tracepoints
glib.mem_alloc, glib.mem_free, glib.mem_realloc, glib.slice_alloc
and glib.slice_free.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1442417924-25831-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -2703,26 +2703,6 @@ static const QEMUOption *lookup_opt(int argc, char **argv, return popt; } -static gpointer malloc_and_trace(gsize n_bytes) -{ - void *ptr = malloc(n_bytes); - trace_g_malloc(n_bytes, ptr); - return ptr; -} - -static gpointer realloc_and_trace(gpointer mem, gsize n_bytes) -{ - void *ptr = realloc(mem, n_bytes); - trace_g_realloc(mem, n_bytes, ptr); - return ptr; -} - -static void free_and_trace(gpointer mem) -{ - trace_g_free(mem); - free(mem); -} - static int machine_set_property(void *opaque, const char *name, const char *value, Error **errp) @@ -2950,11 +2930,6 @@ int main(int argc, char **argv, char **envp) bool userconfig = true; const char *log_mask = NULL; const char *log_file = NULL; - GMemVTable mem_trace = { - .malloc = malloc_and_trace, - .realloc = realloc_and_trace, - .free = free_and_trace, - }; const char *trace_events = NULL; const char *trace_file = NULL; ram_addr_t maxram_size; @@ -2970,8 +2945,6 @@ int main(int argc, char **argv, char **envp) error_set_progname(argv[0]); qemu_init_exec_dir(argv[0]); - g_mem_set_vtable(&mem_trace); - module_call_init(MODULE_INIT_QOM); qemu_add_opts(&qemu_drive_opts); |