]> git.proxmox.com Git - qemu.git/blob - trace-events
trace: Trace qemu_malloc() and qemu_vmalloc()
[qemu.git] / trace-events
1 # Trace events for debugging and performance instrumentation
2 #
3 # This file is processed by the tracetool script during the build.
4 #
5 # To add a new trace event:
6 #
7 # 1. Choose a name for the trace event. Declare its arguments and format
8 # string.
9 #
10 # 2. Call the trace event from code using trace_##name, e.g. multiwrite_cb() ->
11 # trace_multiwrite_cb(). The source file must #include "trace.h".
12 #
13 # Format of a trace event:
14 #
15 # [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
16 #
17 # Example: qemu_malloc(size_t size) "size %zu"
18 #
19 # The "disable" keyword will build without the trace event.
20 # In case of 'simple' trace backend, it will allow the trace event to be
21 # compiled, but this would be turned off by default. It can be toggled on via
22 # the monitor.
23 #
24 # The <name> must be a valid as a C function name.
25 #
26 # Types should be standard C types. Use void * for pointers because the trace
27 # system may not have the necessary headers included.
28 #
29 # The <format-string> should be a sprintf()-compatible format string.
30
31 # qemu-malloc.c
32 disable qemu_malloc(size_t size, void *ptr) "size %zu ptr %p"
33 disable qemu_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
34 disable qemu_free(void *ptr) "ptr %p"
35
36 # osdep.c
37 disable qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
38 disable qemu_valloc(size_t size, void *ptr) "size %zu ptr %p"
39 disable qemu_vfree(void *ptr) "ptr %p"