From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R65d6-0006Qk-4q for qemu-devel@nongnu.org; Tue, 20 Sep 2011 15:05:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R65d5-0005iT-3A for qemu-devel@nongnu.org; Tue, 20 Sep 2011 15:05:16 -0400 Received: from gw.ac.upc.edu ([147.83.30.3]:38163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R65d4-0005iP-ST for qemu-devel@nongnu.org; Tue, 20 Sep 2011 15:05:15 -0400 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 20 Sep 2011 21:03:48 +0200 Message-ID: <20110920190348.25081.18840.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] 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: Stefan Hajnoczi 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 --- docs/tracing.txt | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index d0171aa..b36b54b 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