[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states f
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property |
Date: |
Tue, 13 Oct 2015 21:43:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake writes:
> On 10/13/2015 11:11 AM, Lluís Vilanova wrote:
[...]
>> +##
>> +{ 'command': 'trace-event-get-cpu-state',
>> + 'data': {'name': 'str', 'vcpu': 'int'},
>> + 'returns': ['TraceEventInfo'] }
>> +
>> +##
>> +# @trace-event-set-cpu-state:
>> +#
>> +# Set the dynamic state of events in a given vCPU.
>> +#
>> +# @name: Event name pattern.
>> +# @vcpu: The vCPU to act upon.
>> +# @enable: Whether to enable tracing.
>> +# @ignore-unavailable: #optional Do not match unavailable events with @name.
>> +#
>> +# Since 2.2
> 2.5, not 2.2
Old patches :)
>> +##
>> +{ 'command': 'trace-event-set-cpu-state',
>> + 'data': {'name': 'str', 'vcpu': 'int', 'enable': 'bool',
>> '*ignore-unavailable': 'bool'} }
> This looks identical to trace-event-set-state, except that it now has a
> 'vcpu':'int' argument. Would it be any simpler to just modify the
> existing command:
> ##
> # @trace-event-set-state:
> ...
> # @vcpu: #optional If provided, limit the state change to the given vcpu
> (default act on all vcpus) (since 2.5)
> #
> # Since 2.2
> ##
> { 'command': 'trace-event-set-state',
> 'data': {'name': 'str', 'enable': 'bool',
> '*vcpu': 'int', '*ignore-unavailable': 'bool'} }
Hmmm, this certainly minimizes the interface size, but in exchange breaks the
symmetry between trace-event-get-state/trace-event-set-state and
trace-event-get-cpu-state/trace-event-set-cpu-state, and the symmetry between
these commands and the function inside QEMU (this last one probably not very
important).
What I could do is also merge trace-event-get-state and
trace-event-get-cpu-state into a single command with an optional cpu.
This reminds me that the meaning of "get-state" for per-vCPU events is somewhat
tricky in the current implementation. There's a per-event boolean with the
system-wide tracing state, and a per-cpu-and-event boolean for the per-CPU
tracing state. The get/set-event functions let you interact with type of
booleans separately.
If anyone sees it useful, I can make it a bit easier to understand: if no CPU
number is provided, get-state returns true if it's set on any CPU, and set-state
sets the state on all CPUs by default.
Thanks,
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
- Re: [Qemu-devel] [PATCHv13/8] trace: [tcg] Identify events with the 'vcpu' property, (continued)
[Qemu-devel] [PATCHv15/8] exec: [ŧcg] Use multiple physical TB caches, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv14/8] exec: [tcg] Refactor flush of per-CPU virtual TB cache, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv12/8] trace: Add 'vcpu' event property, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv17/8] [trivial] Track when QEMU has finished initialization, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv16/8] exec: [tcg] Track which vCPU is performing translation and execution, Lluís Vilanova, 2015/10/13
[Qemu-devel] [PATCHv11/8] trace: Add support for vCPU pointers in trace events, Lluís Vilanova, 2015/10/13
Re: [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states, Lluís Vilanova, 2015/10/13