Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 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 | # |
Stefan Hajnoczi | 1e2cf2b | 2010-05-24 11:32:09 +0100 | [diff] [blame] | 15 | # [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>" |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 16 | # |
| 17 | # Example: qemu_malloc(size_t size) "size %zu" |
| 18 | # |
Stefan Hajnoczi | 1e2cf2b | 2010-05-24 11:32:09 +0100 | [diff] [blame] | 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 | # |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 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. |
Stefan Hajnoczi | cd245a1 | 2010-05-22 18:09:25 +0100 | [diff] [blame] | 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" |
Stefan Hajnoczi | 6d519a5 | 2010-05-22 18:15:08 +0100 | [diff] [blame] | 40 | |
Stefan Hajnoczi | 64979a4 | 2010-05-24 13:19:21 +0100 | [diff] [blame] | 41 | # hw/virtio.c |
| 42 | disable virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u" |
| 43 | disable virtqueue_flush(void *vq, unsigned int count) "vq %p count %u" |
| 44 | disable virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int out_num) "vq %p elem %p in_num %u out_num %u" |
| 45 | disable virtio_queue_notify(void *vdev, int n, void *vq) "vdev %p n %d vq %p" |
| 46 | disable virtio_irq(void *vq) "vq %p" |
| 47 | disable virtio_notify(void *vdev, void *vq) "vdev %p vq %p" |
| 48 | |
Stefan Hajnoczi | 6d519a5 | 2010-05-22 18:15:08 +0100 | [diff] [blame] | 49 | # block.c |
| 50 | disable multiwrite_cb(void *mcb, int ret) "mcb %p ret %d" |
| 51 | disable bdrv_aio_multiwrite(void *mcb, int num_callbacks, int num_reqs) "mcb %p num_callbacks %d num_reqs %d" |
| 52 | disable bdrv_aio_multiwrite_earlyfail(void *mcb) "mcb %p" |
| 53 | disable bdrv_aio_multiwrite_latefail(void *mcb, int i) "mcb %p i %d" |
| 54 | |
| 55 | # hw/virtio-blk.c |
| 56 | disable virtio_blk_req_complete(void *req, int status) "req %p status %d" |
| 57 | disable virtio_blk_rw_complete(void *req, int ret) "req %p ret %d" |
| 58 | disable virtio_blk_handle_write(void *req, unsigned long sector, unsigned long nsectors) "req %p sector %lu nsectors %lu" |
| 59 | |
| 60 | # posix-aio-compat.c |
| 61 | disable paio_submit(void *acb, void *opaque, unsigned long sector_num, unsigned long nb_sectors, unsigned long type) "acb %p opaque %p sector_num %lu nb_sectors %lu type %lu" |
Prerna Saxena | bd3c9aa | 2010-08-11 17:15:11 +0530 | [diff] [blame] | 62 | |
| 63 | # ioport.c |
| 64 | disable cpu_in(unsigned int addr, unsigned int val) "addr %#x value %u" |
| 65 | disable cpu_out(unsigned int addr, unsigned int val) "addr %#x value %u" |
Prerna Saxena | 62dd89d | 2010-08-11 17:16:03 +0530 | [diff] [blame^] | 66 | |
| 67 | # balloon.c |
| 68 | # Since requests are raised via monitor, not many tracepoints are needed. |
| 69 | disable balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu" |