]> git.ipfire.org Git - thirdparty/qemu.git/blame - qapi/trace.json
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[thirdparty/qemu.git] / qapi / trace.json
CommitLineData
1dde0f48
LV
1# -*- mode: python -*-
2#
77e2b172 3# Copyright (C) 2011-2016 Lluís Vilanova <vilanova@ac.upc.edu>
1dde0f48
LV
4#
5# This work is licensed under the terms of the GNU GPL, version 2 or later.
6# See the COPYING file in the top-level directory.
7
d3a48372 8##
f5cf31c5 9# = Tracing
d3a48372 10##
1dde0f48
LV
11
12##
13# @TraceEventState:
14#
15# State of a tracing event.
16#
17# @unavailable: The event is statically disabled.
18#
19# @disabled: The event is dynamically disabled.
20#
21# @enabled: The event is dynamically enabled.
22#
5072f7b3 23# Since: 2.2
1dde0f48
LV
24##
25{ 'enum': 'TraceEventState',
26 'data': ['unavailable', 'disabled', 'enabled'] }
27
28##
29# @TraceEventInfo:
30#
31# Information of a tracing event.
32#
33# @name: Event name.
34# @state: Tracing state.
77e2b172
LV
35# @vcpu: Whether this is a per-vCPU event (since 2.7).
36#
37# An event is per-vCPU if it has the "vcpu" property in the "trace-events"
38# files.
1dde0f48 39#
5072f7b3 40# Since: 2.2
1dde0f48 41##
895a2a80 42{ 'struct': 'TraceEventInfo',
77e2b172 43 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} }
1dde0f48
LV
44
45##
46# @trace-event-get-state:
47#
48# Query the state of events.
49#
50# @name: Event name pattern (case-sensitive glob).
1d8bda12 51# @vcpu: The vCPU to query (any by default; since 2.7).
1dde0f48
LV
52#
53# Returns: a list of @TraceEventInfo for the matching events
54#
26ec4e53 55# An event is returned if:
100cc4fe 56#
26ec4e53
PM
57# - its name matches the @name pattern, and
58# - if @vcpu is given, the event has the "vcpu" property.
59#
60# Therefore, if @vcpu is given, the operation will only match per-vCPU events,
61# returning their state on the specified vCPU. Special case: if @name is an
62# exact match, @vcpu is given and the event does not have the "vcpu" property,
63# an error is returned.
77e2b172 64#
5072f7b3 65# Since: 2.2
a93b9ba7
MAL
66#
67# Example:
68#
69# -> { "execute": "trace-event-get-state",
70# "arguments": { "name": "qemu_memalign" } }
71# <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
72#
1dde0f48
LV
73##
74{ 'command': 'trace-event-get-state',
77e2b172 75 'data': {'name': 'str', '*vcpu': 'int'},
1dde0f48
LV
76 'returns': ['TraceEventInfo'] }
77
78##
79# @trace-event-set-state:
80#
81# Set the dynamic tracing state of events.
82#
83# @name: Event name pattern (case-sensitive glob).
84# @enable: Whether to enable tracing.
1d8bda12
MA
85# @ignore-unavailable: Do not match unavailable events with @name.
86# @vcpu: The vCPU to act upon (all by default; since 2.7).
77e2b172
LV
87#
88# An event's state is modified if:
89# - its name matches the @name pattern, and
90# - if @vcpu is given, the event has the "vcpu" property.
91#
92# Therefore, if @vcpu is given, the operation will only match per-vCPU events,
93# setting their state on the specified vCPU. Special case: if @name is an exact
94# match, @vcpu is given and the event does not have the "vcpu" property, an
95# error is returned.
1dde0f48 96#
5072f7b3 97# Since: 2.2
8a9b273e
MAL
98#
99# Example:
100#
101# -> { "execute": "trace-event-set-state",
102# "arguments": { "name": "qemu_memalign", "enable": "true" } }
103# <- { "return": {} }
104#
1dde0f48
LV
105##
106{ 'command': 'trace-event-set-state',
77e2b172
LV
107 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
108 '*vcpu': 'int'} }