From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
"Lluís Vilanova" <vilanova@ac.upc.edu>,
"Stefan Hajnoczi" <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 5/5] trace: Update docs to use example events that exist
Date: Wed, 21 Sep 2011 11:36:37 +0100 [thread overview]
Message-ID: <1316601397-19287-6-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1316601397-19287-1-git-send-email-stefanha@linux.vnet.ibm.com>
From: Lluís Vilanova <vilanova@ac.upc.edu>
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 <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
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:
- 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;
}
--
1.7.5.4
next prev parent reply other threads:[~2011-09-21 10:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 10:36 [Qemu-devel] [PULL 0/5] Tracing patches Stefan Hajnoczi
2011-09-21 10:36 ` [Qemu-devel] [PATCH 1/5] trace: allow trace events with string arguments Stefan Hajnoczi
2011-09-21 10:36 ` [Qemu-devel] [PATCH 2/5] MAINTAINERS: add tracing subsystem Stefan Hajnoczi
2011-09-21 10:36 ` [Qemu-devel] [PATCH 3/5] trace: portable simple trace backend using glib Stefan Hajnoczi
2011-09-21 10:36 ` [Qemu-devel] [PATCH 4/5] trace: use binary file open mode in simpletrace Stefan Hajnoczi
2011-09-21 10:36 ` Stefan Hajnoczi [this message]
2011-09-22 15:58 ` [Qemu-devel] [PULL 0/5] Tracing patches Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316601397-19287-6-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=vilanova@ac.upc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).