xref: /qemu/qapi/trace.json (revision b49f4755)
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#
42# @deprecated: Member @vcpu is deprecated, and always ignored.
43#
44# Since: 2.2
45##
46{ 'struct': 'TraceEventInfo',
47  'data': {'name': 'str', 'state': 'TraceEventState',
48           'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } }
49
50##
51# @trace-event-get-state:
52#
53# Query the state of events.
54#
55# @name: Event name pattern (case-sensitive glob).
56#
57# @vcpu: The vCPU to query (since 2.7).
58#
59# Features:
60#
61# @deprecated: Member @vcpu is deprecated, and always ignored.
62#
63# Returns: a list of @TraceEventInfo for the matching events
64#
65# Since: 2.2
66#
67# Example:
68#
69# -> { "execute": "trace-event-get-state",
70#      "arguments": { "name": "qemu_memalign" } }
71# <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] }
72##
73{ 'command': 'trace-event-get-state',
74  'data': {'name': 'str',
75           '*vcpu': {'type': 'int', 'features': ['deprecated'] } },
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#
85# @enable: Whether to enable tracing.
86#
87# @ignore-unavailable: Do not match unavailable events with @name.
88#
89# @vcpu: The vCPU to act upon (all by default; since 2.7).
90#
91# Features:
92#
93# @deprecated: Member @vcpu is deprecated, and always ignored.
94#
95# Since: 2.2
96#
97# Example:
98#
99# -> { "execute": "trace-event-set-state",
100#      "arguments": { "name": "qemu_memalign", "enable": true } }
101# <- { "return": {} }
102##
103{ 'command': 'trace-event-set-state',
104  'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
105           '*vcpu': {'type': 'int', 'features': ['deprecated'] } } }
106