Patchwork [1/7] Add missing tracing to qemu_mallocz()

login
register
mail settings
Submitter Jes Sorensen
Date Dec. 6, 2010, 2:25 p.m.
Message ID <1291645540-9784-2-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/74366/
State New
Headers show

Comments

Jes Sorensen - Dec. 6, 2010, 2:25 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 qemu-malloc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Stefan Hajnoczi - Dec. 6, 2010, 2:42 p.m.
On Mon, Dec 06, 2010 at 03:25:34PM +0100, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
>  qemu-malloc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

Patch

diff --git a/qemu-malloc.c b/qemu-malloc.c
index 28fb05a..b9b3851 100644
--- a/qemu-malloc.c
+++ b/qemu-malloc.c
@@ -64,10 +64,13 @@  void *qemu_realloc(void *ptr, size_t size)
 
 void *qemu_mallocz(size_t size)
 {
+    void *ptr;
     if (!size && !allow_zero_malloc()) {
         abort();
     }
-    return qemu_oom_check(calloc(1, size ? size : 1));
+    ptr = qemu_oom_check(calloc(1, size ? size : 1));
+    trace_qemu_malloc(size, ptr);
+    return ptr;
 }
 
 char *qemu_strdup(const char *str)