xref: /openbmc/qemu/qapi/trace.json (revision e27a9d62)
1# -*- mode: python -*-
2# vim: filetype=python
3#
4# Copyright (C) 2011-2016 Lluís Vilanova <vilanova@ac.upc.edu>
5#
6# This work is licensed under the terms of the GNU GPL, version 2 or later.
7# See the COPYING file in the top-level directory.
8
9##
10# = Tracing
11##
12
13##
14# @TraceEventState:
15#
16# State of a tracing event.
17#
18# @unavailable: The event is statically disabled.
19#
20# @disabled: The event is dynamically disabled.
21#
22# @enabled: The event is dynamically enabled.
23#
24# Since: 2.2
25##
26{ 'enum': 'TraceEventState',
27  'data': ['unavailable', 'disabled', 'enabled'] }
28
29##
30# @TraceEventInfo:
31#
32# Information of a tracing event.
33#
34# @name: Event name.
35#
36# @state: Tracing state.
37#
38# @vcpu: Whether this is a per-vCPU event (since 2.7).
39#
40# Features:
41# @deprecated: Member @vcpu is deprecated, and always ignored.
42#
43# Since: 2.2
44##
45{ 'struct': 'TraceEventInfo',
46  'data': {'name': 'str', 'state': 'TraceEventState',
47           'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } }
48
49##
50# @trace-event-get-state:
51#
52# Query the state of events.
53#
54# @name: Event name pattern (case-sensitive glob).
55#
56# @vcpu: The vCPU to query (since 2.7).
57#
58# Features:
59# @deprecated: Member @vcpu is deprecated, and always ignored.
60#
61# Returns: a list of @TraceEventInfo for the matching events
62#
63# Since: 2.2
64#
65# Example:
66#
67# -> { "execute": "trace-event-get-state",
68#      "arguments": { "name": "qemu_memalign" } }
69# <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] }
70##
71{ 'command': 'trace-event-get-state',
72  'data': {'name': 'str',
73           '*vcpu': {'type': 'int', 'features': ['deprecated'] } },
74  'returns': ['TraceEventInfo'] }
75
76##
77# @trace-event-set-state:
78#
79# Set the dynamic tracing state of events.
80#
81# @name: Event name pattern (case-sensitive glob).
82#
83# @enable: Whether to enable tracing.
84#
85# @ignore-unavailable: Do not match unavailable events with @name.
86#
87# @vcpu: The vCPU to act upon (all by default; since 2.7).
88#
89# Features:
90#
91# @deprecated: Member @vcpu is deprecated, and always ignored.
92#
93# Since: 2.2
94#
95# Example:
96#
97# -> { "execute": "trace-event-set-state",
98#      "arguments": { "name": "qemu_memalign", "enable": true } }
99# <- { "return": {} }
100##
101{ 'command': 'trace-event-set-state',
102  'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
103           '*vcpu': {'type': 'int', 'features': ['deprecated'] } } }
104