From patchwork Tue Sep 20 19:03:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 115623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 44538B6F75 for ; Wed, 21 Sep 2011 05:05:26 +1000 (EST) Received: from localhost ([::1]:57275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R65dA-0006Qp-QI for incoming@patchwork.ozlabs.org; Tue, 20 Sep 2011 15:05:20 -0400 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 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id BD9F76B02CB; Tue, 20 Sep 2011 21:05:12 +0200 (CEST) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 20 Sep 2011 21:03:48 +0200 Message-ID: <20110920190348.25081.18840.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 147.83.30.3 Cc: Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] trace: Update docs to use example events that exist X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The events 'qemu_malloc' and 'qemu_free' used in the examples no longer exist, so use 'qemu_vmalloc' and 'qemu_vfree' instead. Signed-off-by: LluĂ­s 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: - 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" The "trace-events" file is processed by the "tracetool" script during build to generate code for the trace events. Trace events are invoked directly from @@ -40,14 +40,16 @@ source code like this: #include "trace.h" /* needed for trace event prototype */ - void *qemu_malloc(size_t size) + void *qemu_vmalloc(size_t size) { void *ptr; - if (!size && !allow_zero_malloc()) { - abort(); + size_t align = QEMU_VMALLOC_ALIGN; + + if (size < align) { + align = getpagesize(); } - ptr = oom_check(malloc(size ? size : 1)); - trace_qemu_malloc(size, ptr); /* <-- trace event */ + ptr = qemu_memalign(align, size); + trace_qemu_vmalloc(size, ptr); return ptr; }