Received: from eggs.gnu.org ([2001:4830:134:3::10]:53644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm4Ig-0003qH-Pn for qemu-devel@nongnu.org; Tue, 13 Oct 2015 14:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm4Ib-0001T8-Ps for qemu-devel@nongnu.org; Tue, 13 Oct 2015 14:27:50 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:55937 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm4Ib-0001Sk-FI for qemu-devel@nongnu.org; Tue, 13 Oct 2015 14:27:45 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20151013171020.21325.27626.stgit@localhost> <20151013171038.21325.97389.stgit@localhost> <561D4072.1080207@redhat.com> Date: Tue, 13 Oct 2015 20:27:42 +0200 In-Reply-To: <561D4072.1080207@redhat.com> (Eric Blake's message of "Tue, 13 Oct 2015 11:33:38 -0600") Message-ID: <87lhb6mxnl.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCHv13/8] trace: [tcg] Identify events with the 'vcpu' property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster Eric Blake writes: > On 10/13/2015 11:10 AM, Llu=C3=ADs Vilanova wrote: >> Signed-off-by: Llu=C3=ADs Vilanova > If you'd send with 'qemu format-patch/send-email -v1', then your subject > line would be formatted [PATCH v1 3/8] instead of the confusing results > you got by omitting spaces [PATCHv13/8] (this is v13? out of 8?). Also, > no need to include v1 (it's fairly obvious that an unversioned patch is > the first), you really only need the designation for -v2 and beyond. Right, it's just that "stgit mail" does not add the spaces for you. > The one-line commit subject correctly explains the 'what', but there is > no commit body explaining the 'why'. While a commit body is not > mandatory, it usually helps. I've had these lying around for a very long time and now I see I got lazy in writing the descriptions. Sorry about that. >> +++ b/qapi/trace.json >> @@ -1,6 +1,6 @@ >> # -*- mode: python -*- >> # >> -# Copyright (C) 2011-2014 Llu=C3=ADs Vilanova >> +# Copyright (C) 2011-2015 Llu=C3=ADs Vilanova >> # >> # This work is licensed under the terms of the GNU GPL, version 2 or lat= er. >> # See the COPYING file in the top-level directory. >> @@ -29,11 +29,12 @@ >> # >> # @name: Event name. >> # @state: Tracing state. >> +# @vcpu: Whether this is a per-vCPU event. >> # > Missing a '(since 2.5)' comment on the @vcpu line. [...] >> +++ b/trace/qmp.c >> @@ -22,6 +22,8 @@ TraceEventInfoList *qmp_trace_event_get_state(const ch= ar *name, Error **errp) >> while ((ev =3D trace_event_pattern(name, ev)) !=3D NULL) { >> TraceEventInfoList *elem =3D g_new(TraceEventInfoList, 1); elem-> value =3D g_new(TraceEventInfo, 1); >> + elem->value->vcpu =3D >> + trace_event_get_cpu_id(ev) =3D=3D TRACE_CPU_EVENT_COUNT ? f= alse : true; > I'm not a fan of the over-verbose 'cond ? false : true'. It can almost > always be written '!cond' with just as much clarity. In your case: > elem-> value->vcpu =3D trace_event_get_cpu_id(ev) !=3D TRACE_CPU_EVENT_CO= UNT; I guess it's a matter of personal taste. I'll add both to version 2. 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