From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@gmail.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Luiz Capitulino" <lcapitulino@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property
Date: Thu, 14 Jan 2016 11:22:55 +0000 [thread overview]
Message-ID: <20160114112255.GA3055@stefanha-x1.localdomain> (raw)
In-Reply-To: <87a8ohjkle.fsf@fimbulvetr.bsc.es>
[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]
On Thu, Jan 07, 2016 at 07:44:13PM +0100, Lluís Vilanova wrote:
> Stefan Hajnoczi writes:
>
> > On Tue, Nov 24, 2015 at 06:09:36PM +0100, Lluís Vilanova wrote:
> >> @@ -227,6 +228,17 @@ void cpu_dump_statistics(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
> >> void cpu_reset(CPUState *cpu)
> >> {
> >> CPUClass *klass = CPU_GET_CLASS(cpu);
> >> + TraceEvent *ev = NULL;
> >> +
> >> + if (!qemu_initialized) {
>
> > Is there a cleaner place to do this without introducing the
> > qemu_initialized global?
>
> > I guess the problem is that tracing itself is initialized before the
> > vcpus are set up. Is qemu_add_machine_init_done_notifier() sufficient
> > for this purpose?
>
> Right, tracing must be initialized early, while vCPUs do so much later. Also,
> the hook I took for initialization is also called by regular vCPU resets and
> hotplugs. The problem with machine_init is that it only works in full-system
> (softmmu) mode, so it would require a separate initialization call for the user
> mode variants (e.g., linux-user).
>
> It would be much cleaner to add a trace post-initialization routine right before
> main_loop/cpu_loop (doing the per-vCPU tracing state initialization). I'll
> re-check the code to see if there was any other condition that made me take
> 'cpu_reset' instead.
Okay, great.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-01-14 11:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 17:08 [Qemu-devel] [PATCH v2 00/10] trace: Per-vCPU tracing states Lluís Vilanova
2015-11-24 17:08 ` [Qemu-devel] [PATCH v2 01/10] trace: Add support for vCPU pointers in trace events Lluís Vilanova
2015-11-24 17:08 ` [Qemu-devel] [PATCH v2 02/10] trace: Add 'vcpu' event property Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 03/10] trace: [tcg] Identify events with the 'vcpu' property Lluís Vilanova
2015-11-24 17:54 ` Eric Blake
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 04/10] exec: [tcg] Refactor flush of per-CPU virtual TB cache Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 05/10] exec: [ŧcg] Use multiple physical TB caches Lluís Vilanova
2016-01-07 7:49 ` Stefan Hajnoczi
2016-01-07 17:56 ` Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 06/10] exec: [tcg] Track which vCPU is performing translation and execution Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 07/10] [trivial] Track when QEMU has finished initialization Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 08/10] disas: Remove unused macro '_' Lluís Vilanova
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property Lluís Vilanova
2015-11-24 17:57 ` Eric Blake
2015-11-24 18:31 ` Lluís Vilanova
2016-01-07 8:03 ` Stefan Hajnoczi
2016-01-07 18:44 ` Lluís Vilanova
2016-01-14 11:22 ` Stefan Hajnoczi [this message]
2015-11-24 17:09 ` [Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis Lluís Vilanova
2016-01-07 8:05 ` [Qemu-devel] [PATCH v2 00/10] trace: Per-vCPU tracing states Stefan Hajnoczi
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=20160114112255.GA3055@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).