xref: /openbmc/qemu/trace-events (revision d44fe13b)
1d0fb9657SStefano Garzarella# See docs/devel/tracing.rst for syntax documentation.
294a420b1SStefan Hajnoczi#
394a420b1SStefan Hajnoczi# This file is processed by the tracetool script during the build.
494a420b1SStefan Hajnoczi#
594a420b1SStefan Hajnoczi# To add a new trace event:
694a420b1SStefan Hajnoczi#
794a420b1SStefan Hajnoczi# 1. Choose a name for the trace event.  Declare its arguments and format
894a420b1SStefan Hajnoczi#    string.
994a420b1SStefan Hajnoczi#
1094a420b1SStefan Hajnoczi# 2. Call the trace event from code using trace_##name, e.g. multiwrite_cb() ->
1194a420b1SStefan Hajnoczi#    trace_multiwrite_cb().  The source file must #include "trace.h".
1294a420b1SStefan Hajnoczi#
1394a420b1SStefan Hajnoczi# Format of a trace event:
1494a420b1SStefan Hajnoczi#
151e2cf2bcSStefan Hajnoczi# [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
1694a420b1SStefan Hajnoczi#
17a74cd8ccSFrediano Ziglio# Example: g_malloc(size_t size) "size %zu"
1894a420b1SStefan Hajnoczi#
191e2cf2bcSStefan Hajnoczi# The "disable" keyword will build without the trace event.
201e2cf2bcSStefan Hajnoczi#
2194a420b1SStefan Hajnoczi# The <name> must be a valid as a C function name.
2294a420b1SStefan Hajnoczi#
2394a420b1SStefan Hajnoczi# Types should be standard C types.  Use void * for pointers because the trace
2494a420b1SStefan Hajnoczi# system may not have the necessary headers included.
2594a420b1SStefan Hajnoczi#
2694a420b1SStefan Hajnoczi# The <format-string> should be a sprintf()-compatible format string.
27cd245a19SStefan Hajnoczi
28*ad1a706fSRichard Henderson# cpu.c
29*ad1a706fSRichard Hendersonbreakpoint_insert(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x"
30*ad1a706fSRichard Hendersonbreakpoint_remove(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x"
31*ad1a706fSRichard Hendersonbreakpoint_singlestep(int cpu_index, int enabled) "cpu=%d enable=%d"
32*ad1a706fSRichard Henderson
33c57c4658SKevin Wolf# dma-helpers.c
34cbe0ed62SPaolo Bonzinidma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
35c57c4658SKevin Wolfdma_aio_cancel(void *dbs) "dbs=%p"
36c57c4658SKevin Wolfdma_complete(void *dbs, int ret, void *cb) "dbs=%p ret=%d cb=%p"
374be74634SMarkus Armbrusterdma_blk_cb(void *dbs, int ret) "dbs=%p ret=%d"
38c57c4658SKevin Wolfdma_map_wait(void *dbs) "dbs=%p"
39cdbc19ddSAlon Levy
40a50c2ab8SKevin Wolf# job.c
41a50c2ab8SKevin Wolfjob_state_transition(void *job,  int ret, const char *legal, const char *s0, const char *s1) "job %p (ret: %d) attempting %s transition (%s-->%s)"
42a50c2ab8SKevin Wolfjob_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)"
43404ff28dSJohn Snowjob_completed(void *job, int ret) "job %p ret %d"
44a50c2ab8SKevin Wolf
451a90bc81SKevin Wolf# job-qmp.c
461a90bc81SKevin Wolfqmp_job_cancel(void *job) "job %p"
471a90bc81SKevin Wolfqmp_job_pause(void *job) "job %p"
481a90bc81SKevin Wolfqmp_job_resume(void *job) "job %p"
491a90bc81SKevin Wolfqmp_job_complete(void *job) "job %p"
501a90bc81SKevin Wolfqmp_job_finalize(void *job) "job %p"
511a90bc81SKevin Wolfqmp_job_dismiss(void *job) "job %p"
52