[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen stable-4.6] trace: remove malloc tracing



commit 7a88f1257d5261a7bee98facdb97f50d5553060e
Author:     Paolo Bonzini <pbonzini@xxxxxxxxxx>
AuthorDate: Wed Sep 16 17:38:44 2015 +0200
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Fri Jun 10 15:26:24 2016 +0100

    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@xxxxxxxxxx>
    Reviewed-by: Alberto Garcia <berto@xxxxxxxxxx>
    Message-id: 1442417924-25831-1-git-send-email-pbonzini@xxxxxxxxxx
    Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    
    upstream-commit-id: 98cf48f60aa4999f5b2808569a193a401a390e6a
---
 trace-events |  3 ---
 vl.c         | 27 ---------------------------
 2 files changed, 30 deletions(-)

diff --git a/trace-events b/trace-events
index abd1118..3d410be 100644
--- a/trace-events
+++ b/trace-events
@@ -571,9 +571,6 @@ scsi_request_sense(int target, int lun, int tag) "target %d 
lun %d tag %d"
 vm_state_notify(int running, int reason) "running %d reason %d"
 load_file(const char *name, const char *path) "name %s location %s"
 runstate_set(int new_state) "new state %d"
-g_malloc(size_t size, void *ptr) "size %zu ptr %p"
-g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
-g_free(void *ptr) "ptr %p"
 system_wakeup_request(int reason) "reason=%d"
 qemu_system_shutdown_request(void) ""
 qemu_system_powerdown_request(void) ""
diff --git a/vl.c b/vl.c
index 91411c1..b76f16f 100644
--- a/vl.c
+++ b/vl.c
@@ -2628,26 +2628,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(const char *name, const char *value,
                                 void *opaque)
 {
@@ -2763,11 +2743,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;
     const ram_addr_t default_ram_size = (ram_addr_t)DEFAULT_RAM_SIZE *
@@ -2781,8 +2756,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);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.