* [Qemu-devel] [PATCH] trace: Update docs to use example events that exist
@ 2011-09-20 19:03 Lluís Vilanova
2011-09-21 10:34 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Lluís Vilanova @ 2011-09-20 19:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
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>
---
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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Update docs to use example events that exist
2011-09-20 19:03 [Qemu-devel] [PATCH] trace: Update docs to use example events that exist Lluís Vilanova
@ 2011-09-21 10:34 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2011-09-21 10:34 UTC (permalink / raw)
To: Lluís Vilanova; +Cc: qemu-devel
On Tue, Sep 20, 2011 at 09:03:48PM +0200, Lluís Vilanova wrote:
> 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>
> ---
> docs/tracing.txt | 16 +++++++++-------
> 1 files changed, 9 insertions(+), 7 deletions(-)
Thanks, applied to the tracing tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/tracing
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-21 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 19:03 [Qemu-devel] [PATCH] trace: Update docs to use example events that exist Lluís Vilanova
2011-09-21 10:34 ` Stefan Hajnoczi
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).