Received: from eggs.gnu.org ([2001:4830:134:3::10]:53889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm5UE-0005A7-OA for qemu-devel@nongnu.org; Tue, 13 Oct 2015 15:43:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm5UB-0004yI-D2 for qemu-devel@nongnu.org; Tue, 13 Oct 2015 15:43:50 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:43353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm5UB-0004wo-2U for qemu-devel@nongnu.org; Tue, 13 Oct 2015 15:43:47 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20151013171020.21325.27626.stgit@localhost> <20151013171107.21325.37133.stgit@localhost> <561D4466.9030803@redhat.com> Date: Tue, 13 Oct 2015 21:43:43 +0200 In-Reply-To: <561D4466.9030803@redhat.com> (Eric Blake's message of "Tue, 13 Oct 2015 11:50:30 -0600") Message-ID: <877fmqlfkg.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Stefan Hajnoczi , Markus Armbruster , qemu-devel@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Andreas =?utf-8?Q?F=C3=A4rber?= Eric Blake writes: > On 10/13/2015 11:11 AM, Llu=C3=ADs 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-una= vailable': '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 t= he symmetry between trace-event-get-state/trace-event-set-state and trace-event-get-cpu-state/trace-event-set-cpu-state, and the symmetry betwe= en 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 some= what 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 C= PU 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 --=20 "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