summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2011-09-20 21:03:48 +0200
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-09-21 11:32:37 +0100
commit4aec7a7f81d93133f1ed650d0e0a1b541b10c8fe (patch)
tree58386ae6c38b8dfd2b117740c888d64403ffe4d5 /docs
parent8ea967bc46fe81360f1dffe8e46462734ea49cd5 (diff)
downloadqemu-4aec7a7f81d93133f1ed650d0e0a1b541b10c8fe.tar.gz
qemu-4aec7a7f81d93133f1ed650d0e0a1b541b10c8fe.tar.bz2
qemu-4aec7a7f81d93133f1ed650d0e0a1b541b10c8fe.zip
trace: Update docs to use example events that exist
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>
Diffstat (limited to 'docs')
-rw-r--r--docs/tracing.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 2c33a62b98..95ca16c05d 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;
}