blob: c445f547731c24530c8281409fcbc735afc80605 [file] [log] [blame]
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +01001# 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 Hajnoczi1e2cf2b2010-05-24 11:32:09 +010015# [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +010016#
Frediano Ziglioa74cd8c2011-08-31 09:25:35 +020017# Example: g_malloc(size_t size) "size %zu"
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +010018#
Stefan Hajnoczi1e2cf2b2010-05-24 11:32:09 +010019# The "disable" keyword will build without the trace event.
Stefan Hajnoczi1e2cf2b2010-05-24 11:32:09 +010020#
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +010021# The <name> must be a valid as a C function name.
22#
23# Types should be standard C types. Use void * for pointers because the trace
24# system may not have the necessary headers included.
25#
26# The <format-string> should be a sprintf()-compatible format string.
Stefan Hajnoczicd245a12010-05-22 18:09:25 +010027
Prerna Saxenabd3c9aa2010-08-11 17:15:11 +053028# ioport.c
Vladimir Sementsov-Ogievskiydb73ee42017-07-31 19:01:33 +030029cpu_in(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) value %u"
30cpu_out(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) value %u"
Prerna Saxena62dd89d2010-08-11 17:16:03 +053031
32# balloon.c
33# Since requests are raised via monitor, not many tracepoints are needed.
Lluís47f08d72011-08-31 20:31:58 +020034balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
Blue Swirld8023f32010-10-20 16:41:28 +000035
Stefan Hajnoczi94b0b5f2010-11-16 12:20:25 +000036# vl.c
Lluís47f08d72011-08-31 20:31:58 +020037vm_state_notify(int running, int reason) "running %d reason %d"
Gerd Hoffmann45240512013-03-08 11:42:24 +010038load_file(const char *name, const char *path) "name %s location %s"
Kazuya Saito7e866002013-03-22 17:26:59 +090039runstate_set(int new_state) "new state %d"
Alexey Kardashevskiy4fed9422014-03-07 01:33:36 +053040system_wakeup_request(int reason) "reason=%d"
Eric Blakecf83f142017-05-15 16:41:13 -050041qemu_system_shutdown_request(int reason) "reason=%d"
Yang Zhiyongbc78cff2014-06-22 02:43:03 +080042qemu_system_powerdown_request(void) ""
Stefan Hajnoczi298800c2010-12-06 16:08:01 +000043
Stefan Hajnoczi89bd8202011-09-23 08:23:06 +010044# monitor.c
Markus Armbruster93f8f982015-10-15 17:08:31 +020045monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p"
Daniel P. Berrangeafeecec2012-06-14 18:12:57 +010046monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
Markus Armbruster93f8f982015-10-15 17:08:31 +020047monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64
Stefan Hajnoczi79cad8b2017-06-05 11:42:15 +010048handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s"
Stefan Hajnoczib097efc2017-06-05 11:42:16 +010049handle_qmp_command(void *mon, const char *req) "mon %p req: %s"
Peter Xue3e977d2018-03-09 16:59:56 +080050monitor_suspend(void *ptr, int cnt) "mon %p: %d"
Peter Xucf869d52018-03-10 20:38:05 -060051monitor_qmp_cmd_in_band(const char *id) "%s"
52monitor_qmp_cmd_out_of_band(const char *id) "%s"
Max Filippov342407f2011-10-16 02:56:45 +040053
Kevin Wolfc57c4652011-11-24 06:15:28 -050054# dma-helpers.c
Paolo Bonzinicbe0ed62016-05-23 14:54:05 +020055dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
Kevin Wolfc57c4652011-11-24 06:15:28 -050056dma_aio_cancel(void *dbs) "dbs=%p"
57dma_complete(void *dbs, int ret, void *cb) "dbs=%p ret=%d cb=%p"
Markus Armbruster4be74632014-10-07 13:59:18 +020058dma_blk_cb(void *dbs, int ret) "dbs=%p ret=%d"
Kevin Wolfc57c4652011-11-24 06:15:28 -050059dma_map_wait(void *dbs) "dbs=%p"
Alon Levycdbc19d2012-03-11 18:11:26 +020060
Dr. David Alan Gilbertdb144f72018-03-12 17:20:56 +000061# exec.c
Dr. David Alan Gilbert154cc9e2018-01-05 17:01:37 +000062find_ram_offset(uint64_t size, uint64_t offset) "size: 0x%" PRIx64 " @ 0x%" PRIx64
63find_ram_offset_loop(uint64_t size, uint64_t candidate, uint64_t offset, uint64_t next, uint64_t mingap) "trying size: 0x%" PRIx64 " @ 0x%" PRIx64 ", offset: 0x%" PRIx64" next: 0x%" PRIx64 " mingap: 0x%" PRIx64
Dr. David Alan Gilbertdb144f72018-03-12 17:20:56 +000064ram_block_discard_range(const char *rbname, void *hva, size_t length, bool need_madvise, bool need_fallocate, int ret) "%s@%p + 0x%zx: madvise: %d fallocate: %d ret: %d"
Dr. David Alan Gilbert154cc9e2018-01-05 17:01:37 +000065
Paolo Bonzini55d5d042013-07-28 14:57:22 +020066# memory.c
Vladimir Sementsov-Ogievskiydb73ee42017-07-31 19:01:33 +030067memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
68memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
69memory_region_subpage_read(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx64" size %u"
70memory_region_subpage_write(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx64" size %u"
71memory_region_tb_read(int cpu_index, uint64_t addr, uint64_t value, unsigned size) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
72memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned size) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
73memory_region_ram_device_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
74memory_region_ram_device_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
Daniel P. Berrangé88584442018-03-08 15:55:23 +000075flatview_new(void *view, void *root) "%p (root %p)"
76flatview_destroy(void *view, void *root) "%p (root %p)"
77flatview_destroy_rcu(void *view, void *root) "%p (root %p)"
Paolo Bonzini55d5d042013-07-28 14:57:22 +020078
Doug Gale5c9522b2017-12-02 20:30:37 -050079# gdbstub.c
Stefan Hajnoczi7f1d87a2018-02-01 16:26:25 +000080gdbstub_op_start(const char *device) "Starting gdbstub using device %s"
Doug Gale5c9522b2017-12-02 20:30:37 -050081gdbstub_op_exiting(uint8_t code) "notifying exit with code=0x%02x"
82gdbstub_op_continue(void) "Continuing all CPUs"
83gdbstub_op_continue_cpu(int cpu_index) "Continuing CPU %d"
84gdbstub_op_stepping(int cpu_index) "Stepping CPU %d"
Stefan Hajnoczi7f1d87a2018-02-01 16:26:25 +000085gdbstub_op_extra_info(const char *info) "Thread extra info: %s"
86gdbstub_hit_watchpoint(const char *type, int cpu_gdb_index, uint64_t vaddr) "Watchpoint hit, type=\"%s\" cpu=%d, vaddr=0x%" PRIx64 ""
Doug Gale5c9522b2017-12-02 20:30:37 -050087gdbstub_hit_internal_error(void) "RUN_STATE_INTERNAL_ERROR"
88gdbstub_hit_break(void) "RUN_STATE_DEBUG"
89gdbstub_hit_paused(void) "RUN_STATE_PAUSED"
90gdbstub_hit_shutdown(void) "RUN_STATE_SHUTDOWN"
91gdbstub_hit_io_error(void) "RUN_STATE_IO_ERROR"
92gdbstub_hit_watchdog(void) "RUN_STATE_WATCHDOG"
93gdbstub_hit_unknown(int state) "Unknown run state=0x%x"
Stefan Hajnoczi7f1d87a2018-02-01 16:26:25 +000094gdbstub_io_reply(const char *message) "Sent: %s"
95gdbstub_io_binaryreply(size_t ofs, const char *line) "0x%04zx: %s"
96gdbstub_io_command(const char *command) "Received: %s"
Doug Gale5c9522b2017-12-02 20:30:37 -050097gdbstub_io_got_ack(void) "Got ACK"
98gdbstub_io_got_unexpected(uint8_t ch) "Got 0x%02x when expecting ACK/NACK"
99gdbstub_err_got_nack(void) "Got NACK, retransmitting"
100gdbstub_err_garbage(uint8_t ch) "received garbage between packets: 0x%02x"
101gdbstub_err_overrun(void) "command buffer overrun, dropping command"
102gdbstub_err_invalid_repeat(uint8_t ch) "got invalid RLE count: 0x%02x"
103gdbstub_err_invalid_rle(void) "got invalid RLE sequence"
104gdbstub_err_checksum_invalid(uint8_t ch) "got invalid command checksum digit: 0x%02x"
105gdbstub_err_checksum_incorrect(uint8_t expected, uint8_t got) "got command packet with incorrect checksum, expected=0x%02x, received=0x%02x"
106
Kevin Wolfa50c2ab2018-04-13 17:19:31 +0200107# job.c
108job_state_transition(void *job, int ret, const char *legal, const char *s0, const char *s1) "job %p (ret: %d) attempting %s transition (%s-->%s)"
109job_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)"
Kevin Wolf3d70ff52018-04-24 16:13:52 +0200110job_completed(void *job, int ret, int jret) "job %p ret %d corrected ret %d"
Kevin Wolfa50c2ab2018-04-13 17:19:31 +0200111
Kevin Wolf1a90bc82018-05-03 19:01:14 +0200112# job-qmp.c
113qmp_job_cancel(void *job) "job %p"
114qmp_job_pause(void *job) "job %p"
115qmp_job_resume(void *job) "job %p"
116qmp_job_complete(void *job) "job %p"
117qmp_job_finalize(void *job) "job %p"
118qmp_job_dismiss(void *job) "job %p"
119
120
Lluís Vilanovadcdaadb2016-06-09 19:31:47 +0200121### Guest events, keep at bottom
122
Lluís Vilanovab9d72212016-09-19 14:55:13 +0200123
124## vCPU
125
126# Hot-plug a new virtual (guest) CPU
127#
Lluís Vilanovaf5e2b3b2016-10-05 14:03:29 +0200128# Mode: user, softmmu
Lluís Vilanovab9d72212016-09-19 14:55:13 +0200129# Targets: all
130vcpu guest_cpu_enter(void)
131
Lluís Vilanovaa47e8712016-12-26 22:24:46 +0100132# Hot-unplug a virtual (guest) CPU
133#
134# Mode: user, softmmu
135# Targets: all
136vcpu guest_cpu_exit(void)
137
Lluís Vilanova2cc2d082016-09-19 14:55:18 +0200138# Reset the state of a virtual (guest) CPU
139#
Lluís Vilanovaf5e2b3b2016-10-05 14:03:29 +0200140# Mode: user, softmmu
Lluís Vilanova2cc2d082016-09-19 14:55:18 +0200141# Targets: all
142vcpu guest_cpu_reset(void)
143
Lluís Vilanovadcdaadb2016-06-09 19:31:47 +0200144# @vaddr: Access' virtual address.
145# @info : Access' information (see below).
146#
147# Start virtual memory access (before any potential access violation).
148#
149# Does not include memory accesses performed by devices.
150#
151# Access information can be parsed as:
152#
153# struct mem_info {
154# uint8_t size_shift : 2; /* interpreted as "1 << size_shift" bytes */
155# bool sign_extend: 1; /* sign-extended */
156# uint8_t endianness : 1; /* 0: little, 1: big */
157# bool store : 1; /* wheter it's a store operation */
158# };
159#
Lluís Vilanova43e21e42016-09-22 20:40:21 +0200160# Mode: user, softmmu
Lluís Vilanovadcdaadb2016-06-09 19:31:47 +0200161# Targets: TCG(all)
Lluís Vilanova5caa2622017-07-04 10:54:52 +0200162vcpu tcg guest_mem_before(TCGv vaddr, uint8_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d"
Lluís Vilanova9c15e702016-06-21 15:52:04 +0200163
164# @num: System call number.
165# @arg*: System call argument value.
166#
167# Start executing a guest system call in syscall emulation mode.
168#
Lluís Vilanova43e21e42016-09-22 20:40:21 +0200169# Mode: user
Lluís Vilanova9c15e702016-06-21 15:52:04 +0200170# Targets: TCG(all)
Lluís Vilanova5caa2622017-07-04 10:54:52 +0200171vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64_t arg8) "num=0x%016"PRIx64" arg1=0x%016"PRIx64" arg2=0x%016"PRIx64" arg3=0x%016"PRIx64" arg4=0x%016"PRIx64" arg5=0x%016"PRIx64" arg6=0x%016"PRIx64" arg7=0x%016"PRIx64" arg8=0x%016"PRIx64
Lluís Vilanova9c15e702016-06-21 15:52:04 +0200172
173# @num: System call number.
174# @ret: System call result value.
175#
176# Finish executing a guest system call in syscall emulation mode.
177#
Lluís Vilanova43e21e42016-09-22 20:40:21 +0200178# Mode: user
Lluís Vilanova9c15e702016-06-21 15:52:04 +0200179# Targets: TCG(all)
Lluís Vilanova5caa2622017-07-04 10:54:52 +0200180vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=0x%016"PRIx64" ret=0x%016"PRIx64