From: Eric Blake <eblake@redhat.com>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCHv13/8] trace: [tcg] Identify events with the 'vcpu' property
Date: Tue, 13 Oct 2015 11:33:38 -0600 [thread overview]
Message-ID: <561D4072.1080207@redhat.com> (raw)
In-Reply-To: <20151013171038.21325.97389.stgit@localhost>
[-- Attachment #1: Type: text/plain, Size: 2343 bytes --]
On 10/13/2015 11:10 AM, Lluís Vilanova wrote:
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
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.
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.
> +++ b/qapi/trace.json
> @@ -1,6 +1,6 @@
> # -*- mode: python -*-
> #
> -# Copyright (C) 2011-2014 Lluís Vilanova <vilanova@ac.upc.edu>
> +# Copyright (C) 2011-2015 Lluís Vilanova <vilanova@ac.upc.edu>
> #
> # This work is licensed under the terms of the GNU GPL, version 2 or later.
> # 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.
> # Since 2.2
> ##
> { 'struct': 'TraceEventInfo',
> - 'data': {'name': 'str', 'state': 'TraceEventState'} }
> + 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} }
This is okay from the qapi interface perspective (events are output, so
unconditional addition of new fields won't break existing clients).
I did not closely review the rest, however, I did spot this:
> +++ b/trace/qmp.c
> @@ -22,6 +22,8 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, Error **errp)
> while ((ev = trace_event_pattern(name, ev)) != NULL) {
> TraceEventInfoList *elem = g_new(TraceEventInfoList, 1);
> elem->value = g_new(TraceEventInfo, 1);
> + elem->value->vcpu =
> + trace_event_get_cpu_id(ev) == TRACE_CPU_EVENT_COUNT ? false : 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 = trace_event_get_cpu_id(ev) != TRACE_CPU_EVENT_COUNT;
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-10-13 17:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 17:10 [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv11/8] trace: Add support for vCPU pointers in trace events Lluís Vilanova
2015-10-16 9:13 ` Stefan Hajnoczi
2015-10-16 15:12 ` Eduardo Habkost
2015-10-16 15:44 ` Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv12/8] trace: Add 'vcpu' event property Lluís Vilanova
2015-10-16 9:16 ` Stefan Hajnoczi
2015-10-16 15:45 ` Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv13/8] trace: [tcg] Identify events with the 'vcpu' property Lluís Vilanova
2015-10-13 17:33 ` Eric Blake [this message]
2015-10-13 18:27 ` Lluís Vilanova
2015-10-13 18:57 ` Markus Armbruster
2015-10-13 17:10 ` [Qemu-devel] [PATCHv14/8] exec: [tcg] Refactor flush of per-CPU virtual TB cache Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv15/8] exec: [ŧcg] Use multiple physical TB caches Lluís Vilanova
2015-10-13 17:10 ` [Qemu-devel] [PATCHv16/8] exec: [tcg] Track which vCPU is performing translation and execution Lluís Vilanova
2015-10-13 17:11 ` [Qemu-devel] [PATCHv17/8] [trivial] Track when QEMU has finished initialization Lluís Vilanova
2015-10-13 18:56 ` Markus Armbruster
2015-10-13 17:11 ` [Qemu-devel] [PATCHv18/8] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property Lluís Vilanova
2015-10-13 17:50 ` Eric Blake
2015-10-13 19:43 ` Lluís Vilanova
2015-10-16 9:19 ` Stefan Hajnoczi
2015-10-16 15:42 ` Lluís Vilanova
2015-10-13 17:26 ` [Qemu-devel] [RFC][PATCHv10/8] trace: Per-vCPU tracing states Lluís Vilanova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561D4072.1080207@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
--cc=vilanova@ac.upc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).