2014-08-25 13:19:57 +02:00
|
|
|
# -*- mode: python -*-
|
2021-12-20 15:56:24 +01:00
|
|
|
# vim: filetype=python
|
2014-08-25 13:19:57 +02:00
|
|
|
#
|
2016-07-11 12:53:57 +02:00
|
|
|
# Copyright (C) 2011-2016 Lluís Vilanova <vilanova@ac.upc.edu>
|
2014-08-25 13:19:57 +02:00
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
|
2017-01-13 15:41:23 +01:00
|
|
|
##
|
2017-08-24 21:14:08 +02:00
|
|
|
# = Tracing
|
2017-01-13 15:41:23 +01:00
|
|
|
##
|
2014-08-25 13:19:57 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# @TraceEventState:
|
|
|
|
#
|
|
|
|
# State of a tracing event.
|
|
|
|
#
|
|
|
|
# @unavailable: The event is statically disabled.
|
|
|
|
#
|
|
|
|
# @disabled: The event is dynamically disabled.
|
|
|
|
#
|
|
|
|
# @enabled: The event is dynamically enabled.
|
|
|
|
#
|
2016-11-17 16:54:55 +01:00
|
|
|
# Since: 2.2
|
2014-08-25 13:19:57 +02:00
|
|
|
##
|
|
|
|
{ 'enum': 'TraceEventState',
|
|
|
|
'data': ['unavailable', 'disabled', 'enabled'] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @TraceEventInfo:
|
|
|
|
#
|
|
|
|
# Information of a tracing event.
|
|
|
|
#
|
|
|
|
# @name: Event name.
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2014-08-25 13:19:57 +02:00
|
|
|
# @state: Tracing state.
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2016-07-11 12:53:57 +02:00
|
|
|
# @vcpu: Whether this is a per-vCPU event (since 2.7).
|
|
|
|
#
|
2023-04-28 12:54:29 +02:00
|
|
|
# An event is per-vCPU if it has the "vcpu" property in the
|
|
|
|
# "trace-events" files.
|
2014-08-25 13:19:57 +02:00
|
|
|
#
|
2016-11-17 16:54:55 +01:00
|
|
|
# Since: 2.2
|
2014-08-25 13:19:57 +02:00
|
|
|
##
|
2015-05-04 17:05:27 +02:00
|
|
|
{ 'struct': 'TraceEventInfo',
|
2016-07-11 12:53:57 +02:00
|
|
|
'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} }
|
2014-08-25 13:19:57 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# @trace-event-get-state:
|
|
|
|
#
|
|
|
|
# Query the state of events.
|
|
|
|
#
|
|
|
|
# @name: Event name pattern (case-sensitive glob).
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2017-03-15 13:57:06 +01:00
|
|
|
# @vcpu: The vCPU to query (any by default; since 2.7).
|
2014-08-25 13:19:57 +02:00
|
|
|
#
|
|
|
|
# Returns: a list of @TraceEventInfo for the matching events
|
|
|
|
#
|
2023-04-28 12:54:29 +02:00
|
|
|
# An event is returned if:
|
2020-02-13 18:56:33 +01:00
|
|
|
#
|
2023-04-28 12:54:29 +02:00
|
|
|
# - its name matches the @name pattern, and
|
|
|
|
# - if @vcpu is given, the event has the "vcpu" property.
|
2020-02-13 18:56:26 +01:00
|
|
|
#
|
2023-04-28 12:54:29 +02:00
|
|
|
# Therefore, if @vcpu is given, the operation will only match per-vCPU
|
|
|
|
# events, returning their state on the specified vCPU. Special case:
|
|
|
|
# if @name is an exact match, @vcpu is given and the event does not
|
|
|
|
# have the "vcpu" property, an error is returned.
|
2016-07-11 12:53:57 +02:00
|
|
|
#
|
2016-11-17 16:54:55 +01:00
|
|
|
# Since: 2.2
|
2016-06-23 15:20:58 +02:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "trace-event-get-state",
|
|
|
|
# "arguments": { "name": "qemu_memalign" } }
|
2022-03-31 21:06:31 +02:00
|
|
|
# <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] }
|
2014-08-25 13:19:57 +02:00
|
|
|
##
|
|
|
|
{ 'command': 'trace-event-get-state',
|
2016-07-11 12:53:57 +02:00
|
|
|
'data': {'name': 'str', '*vcpu': 'int'},
|
2014-08-25 13:19:57 +02:00
|
|
|
'returns': ['TraceEventInfo'] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @trace-event-set-state:
|
|
|
|
#
|
|
|
|
# Set the dynamic tracing state of events.
|
|
|
|
#
|
|
|
|
# @name: Event name pattern (case-sensitive glob).
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2014-08-25 13:19:57 +02:00
|
|
|
# @enable: Whether to enable tracing.
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2017-03-15 13:57:06 +01:00
|
|
|
# @ignore-unavailable: Do not match unavailable events with @name.
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2017-03-15 13:57:06 +01:00
|
|
|
# @vcpu: The vCPU to act upon (all by default; since 2.7).
|
2016-07-11 12:53:57 +02:00
|
|
|
#
|
|
|
|
# An event's state is modified if:
|
2023-04-25 08:42:16 +02:00
|
|
|
#
|
2016-07-11 12:53:57 +02:00
|
|
|
# - its name matches the @name pattern, and
|
|
|
|
# - if @vcpu is given, the event has the "vcpu" property.
|
|
|
|
#
|
2023-04-28 12:54:29 +02:00
|
|
|
# Therefore, if @vcpu is given, the operation will only match per-vCPU
|
|
|
|
# events, setting their state on the specified vCPU. Special case: if
|
|
|
|
# @name is an exact match, @vcpu is given and the event does not have
|
|
|
|
# the "vcpu" property, an error is returned.
|
2014-08-25 13:19:57 +02:00
|
|
|
#
|
2016-11-17 16:54:55 +01:00
|
|
|
# Since: 2.2
|
2016-06-23 15:21:49 +02:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "trace-event-set-state",
|
2021-08-27 11:06:27 +02:00
|
|
|
# "arguments": { "name": "qemu_memalign", "enable": true } }
|
2016-06-23 15:21:49 +02:00
|
|
|
# <- { "return": {} }
|
2014-08-25 13:19:57 +02:00
|
|
|
##
|
|
|
|
{ 'command': 'trace-event-set-state',
|
2016-07-11 12:53:57 +02:00
|
|
|
'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
|
|
|
|
'*vcpu': 'int'} }
|