xref: /openbmc/qemu/trace-events (revision 94a420b1)
1*94a420b1SStefan Hajnoczi# Trace events for debugging and performance instrumentation
2*94a420b1SStefan Hajnoczi#
3*94a420b1SStefan Hajnoczi# This file is processed by the tracetool script during the build.
4*94a420b1SStefan Hajnoczi#
5*94a420b1SStefan Hajnoczi# To add a new trace event:
6*94a420b1SStefan Hajnoczi#
7*94a420b1SStefan Hajnoczi# 1. Choose a name for the trace event.  Declare its arguments and format
8*94a420b1SStefan Hajnoczi#    string.
9*94a420b1SStefan Hajnoczi#
10*94a420b1SStefan Hajnoczi# 2. Call the trace event from code using trace_##name, e.g. multiwrite_cb() ->
11*94a420b1SStefan Hajnoczi#    trace_multiwrite_cb().  The source file must #include "trace.h".
12*94a420b1SStefan Hajnoczi#
13*94a420b1SStefan Hajnoczi# Format of a trace event:
14*94a420b1SStefan Hajnoczi#
15*94a420b1SStefan Hajnoczi# <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
16*94a420b1SStefan Hajnoczi#
17*94a420b1SStefan Hajnoczi# Example: qemu_malloc(size_t size) "size %zu"
18*94a420b1SStefan Hajnoczi#
19*94a420b1SStefan Hajnoczi# The <name> must be a valid as a C function name.
20*94a420b1SStefan Hajnoczi#
21*94a420b1SStefan Hajnoczi# Types should be standard C types.  Use void * for pointers because the trace
22*94a420b1SStefan Hajnoczi# system may not have the necessary headers included.
23*94a420b1SStefan Hajnoczi#
24*94a420b1SStefan Hajnoczi# The <format-string> should be a sprintf()-compatible format string.
25