xref: /openbmc/qemu/trace-events (revision e6459afb1ff4d86b361b14f4a2fc43f0d2b4d679)
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
33a50c2ab8SKevin Wolf# job.c
34a50c2ab8SKevin 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)"
35a50c2ab8SKevin Wolfjob_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)"
36404ff28dSJohn Snowjob_completed(void *job, int ret) "job %p ret %d"
37a50c2ab8SKevin Wolf
381a90bc81SKevin Wolf# job-qmp.c
391a90bc81SKevin Wolfqmp_job_cancel(void *job) "job %p"
401a90bc81SKevin Wolfqmp_job_pause(void *job) "job %p"
411a90bc81SKevin Wolfqmp_job_resume(void *job) "job %p"
421a90bc81SKevin Wolfqmp_job_complete(void *job) "job %p"
431a90bc81SKevin Wolfqmp_job_finalize(void *job) "job %p"
441a90bc81SKevin Wolfqmp_job_dismiss(void *job) "job %p"
45