提交 4b710a3c 编写于 作者: L Lluís Vilanova 提交者: Stefan Hajnoczi

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: NLluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 6c2a4074
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册