[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing stat
From: |
Stefan Hajnoczi |
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 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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
signature.asc
Description: PGP signature