From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKquf-0007CE-HR for qemu-devel@nongnu.org; Fri, 22 Aug 2014 11:38:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKqua-00041b-Vw for qemu-devel@nongnu.org; Fri, 22 Aug 2014 11:38:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKqua-00041X-P3 for qemu-devel@nongnu.org; Fri, 22 Aug 2014 11:37:56 -0400 Message-ID: <53F763CD.7080202@redhat.com> Date: Fri, 22 Aug 2014 09:37:49 -0600 From: Eric Blake MIME-Version: 1.0 References: <20140821175235.12061.22630.stgit@fimbulvetr.bsc.es> In-Reply-To: <20140821175235.12061.22630.stgit@fimbulvetr.bsc.es> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EDLEppTv7tf0MKnk0CwcVcScACnGr4kp5" Subject: Re: [Qemu-devel] [PATCH v3] trace: [qmp] Add QAPI/QMP commands to query and control event tracing state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= , qemu-devel@nongnu.org Cc: Michael Roth , Markus Armbruster , Stefan Hajnoczi , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EDLEppTv7tf0MKnk0CwcVcScACnGr4kp5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/21/2014 11:52 AM, Llu=C3=ADs Vilanova wrote: > Also removes old "trace-event", "trace-file" and "info trace-events" HM= P > commands. >=20 > Signed-off-by: Llu=C3=ADs Vilanova > --- > monitor.c | 24 +++++++--------- > qapi-schema.json | 3 ++ > qapi/trace.json | 44 +++++++++++++++++++++++++++++ > qmp-commands.hx | 27 ++++++++++++++++++ > trace/Makefile.objs | 1 + > trace/control.c | 13 --------- > trace/control.h | 7 ----- > trace/qmp.c | 77 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 8 files changed, 162 insertions(+), 34 deletions(-) > create mode 100644 qapi/trace.json > create mode 100644 trace/qmp.c >=20 > +++ b/qapi/trace.json > @@ -0,0 +1,44 @@ > +# -*- mode: python -*- > + No copyright statement (but you are just following (poor) existing practice). > +## > +# @TraceEventState: > +# > +# State of a tracing event. > +# > +# @name: Event name. > +# @sstatic: Static tracing state. > +# @sdynamic: Dynamic tracing state. Does the leading 's' add any value? QAPI doesn't have to use obscure abbreviations. > +# > +# Since 2.2 > +## > +{ 'type': 'TraceEventState', > + 'data': {'name': 'str', 'sstatic': 'bool', 'sdynamic': 'bool'} } Are all four states between the combinations of the two bools possible, or is this more of a tri-state setting (default, sstatic, or sdynamic), in which case a single parameter of enum type would be better than two bools? > + > +## > +# @trace-event-get-state: > +# > +# Query the state of events. > +# > +# @name: Event name pattern. glob? regex? Is the pattern anchored or just substring analysis? Case-sensitive? > +# > +# Returns: @TraceEventState of the matched events > +# > +# Since 2.2 > +## > +{ 'command': 'trace-event-get-state', > + 'data': {'name': 'str'}, > + 'returns': ['TraceEventState'] } What if I want ALL events? Can name be made optional to avoid any filtering? > + > +## > +# @trace-event-set-state: > +# > +# Set the dynamic state of events. > +# > +# @name: Event name pattern. Same comments about pattern as before. > +# @state: Dynamic tracing state. > +# @keepgoing: #optional Apply changes even if not all events can be ch= anged. keep-going - use dash to separate words for legibility > +# > +# Since 2.2 > +## > +{ 'command': 'trace-event-set-state', > + 'data': {'name': 'str', 'state': 'bool', '*keepgoing': 'bool'} } This only lets me set the state of one name at a time. Oh, unless I'm setting a pattern, and it then sets the state of all names that match that pattern. I'm wondering if you should have 'name':['str'] to allow me to set multiple names/patterns in one go, instead of having to call the command multiple times; but it's probably not worth the complexity. > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 4be4765..443dd16 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -3753,5 +3753,32 @@ Example: > =20 > -> { "execute": "rtc-reset-reinjection" } > <- { "return": {} } > +EQMP > + > + { > + .name =3D "trace-event-get-state", > + .args_type =3D "name:s", > + .mhandler.cmd_new =3D qmp_marshal_input_trace_event_get_state,= > + }, > + > +SQMP > +trace-event-get-state > +--------------------- > + > +Query the state of events. No example usage? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EDLEppTv7tf0MKnk0CwcVcScACnGr4kp5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT92PNAAoJEKeha0olJ0Nqog8H/R1CaCVgpdSYAaeeRlTmv2BL l9pDR1HMRhISJEXotw/9iOr8sbLhCoe51SiZFy2PeGmng/XVHp4kJPkXZMWBR0M0 MZPYEGFVX+1zBzreLtGX/oq6PTkP2AmQlPwwXSd+OoO6DZsOUZIDSmzbLvqDRT7J 2seLhMgithlE9+2fvuNY+g677+LZUDC/W3Qa4daRCMYXA6MIo9Ev8Beq0yZpKTdX IpYyIGsJXSKr2N/3uSURrUUvRM5phAEWKRqKrJRoAoLw1QzYS4o//qC8B7yVOWDf VIlGSTQ78ih4eQcqgOCJs2x83iNyrnAD5bO/wBbTArlqEhvBvSXr6BfDHEsaZTw= =CcR2 -----END PGP SIGNATURE----- --EDLEppTv7tf0MKnk0CwcVcScACnGr4kp5--