From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6KAc-0004LT-Df for qemu-devel@nongnu.org; Wed, 21 Sep 2011 06:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6KAZ-0008Lz-1R for qemu-devel@nongnu.org; Wed, 21 Sep 2011 06:36:50 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:34678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6KAY-0008Lf-Jw for qemu-devel@nongnu.org; Wed, 21 Sep 2011 06:36:47 -0400 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p8LAajT4024205 for ; Wed, 21 Sep 2011 10:36:45 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8LAajIS2343020 for ; Wed, 21 Sep 2011 11:36:45 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8LHagKD031490 for ; Wed, 21 Sep 2011 11:36:43 -0600 From: Stefan Hajnoczi Date: Wed, 21 Sep 2011 11:36:37 +0100 Message-Id: <1316601397-19287-6-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1316601397-19287-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1316601397-19287-1-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 5/5] trace: Update docs to use example events that exist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi From: Llu=C3=ADs Vilanova The events 'qemu_malloc' and 'qemu_free' used in the examples no longer e= xist, so use 'qemu_vmalloc' and 'qemu_vfree' instead. Signed-off-by: Llu=C3=ADs Vilanova Signed-off-by: Stefan Hajnoczi --- docs/tracing.txt | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index 2c33a62..95ca16c 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -31,8 +31,8 @@ There is a set of static trace events declared in the "= trace-events" source file. Each trace event declaration names the event, its arguments, and = the format string which can be used for pretty-printing: =20 - qemu_malloc(size_t size, void *ptr) "size %zu ptr %p" - qemu_free(void *ptr) "ptr %p" + qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p" + qemu_vfree(void *ptr) "ptr %p" =20 The "trace-events" file is processed by the "tracetool" script during bu= ild to generate code for the trace events. Trace events are invoked directly f= rom @@ -40,14 +40,16 @@ source code like this: =20 #include "trace.h" /* needed for trace event prototype */ =20 - void *qemu_malloc(size_t size) + void *qemu_vmalloc(size_t size) { void *ptr; - if (!size && !allow_zero_malloc()) { - abort(); + size_t align =3D QEMU_VMALLOC_ALIGN; + =20 + if (size < align) { + align =3D getpagesize(); } - ptr =3D oom_check(malloc(size ? size : 1)); - trace_qemu_malloc(size, ptr); /* <-- trace event */ + ptr =3D qemu_memalign(align, size); + trace_qemu_vmalloc(size, ptr); return ptr; } =20 --=20 1.7.5.4