From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJfzd-0002Ms-K7 for qemu-devel@nongnu.org; Thu, 14 Jan 2016 06:23:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJfzY-0005ty-0B for qemu-devel@nongnu.org; Thu, 14 Jan 2016 06:23:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJfzX-0005to-QM for qemu-devel@nongnu.org; Thu, 14 Jan 2016 06:22:59 -0500 Date: Thu, 14 Jan 2016 11:22:55 +0000 From: Stefan Hajnoczi Message-ID: <20160114112255.GA3055@stefanha-x1.localdomain> References: <144838492534.3052.2948919558518613064.stgit@localhost> <144838497636.3052.15443880874914788795.stgit@localhost> <20160107080300.GG12971@stefanha-x1.localdomain> <87a8ohjkle.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <87a8ohjkle.fsf@fimbulvetr.bsc.es> Subject: Re: [Qemu-devel] [PATCH v2 09/10] trace: [tcg] Add per-vCPU tracing states for events with the 'vcpu' property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Llu=EDs?= Vilanova Cc: Eduardo Habkost , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster , Luiz Capitulino , Andreas =?iso-8859-1?Q?F=E4rber?= --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 07, 2016 at 07:44:13PM +0100, Llu=EDs Vilanova wrote: > Stefan Hajnoczi writes: >=20 > > On Tue, Nov 24, 2015 at 06:09:36PM +0100, Llu=EDs 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 =3D CPU_GET_CLASS(cpu); > >> + TraceEvent *ev =3D NULL; > >> + > >> + if (!qemu_initialized) { >=20 > > Is there a cleaner place to do this without introducing the > > qemu_initialized global? >=20 > > 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? >=20 > Right, tracing must be initialized early, while vCPUs do so much later. A= lso, > 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-sys= tem > (softmmu) mode, so it would require a separate initialization call for th= e user > mode variants (e.g., linux-user). >=20 > 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 ta= ke > 'cpu_reset' instead. Okay, great. Stefan --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWl4UPAAoJEJykq7OBq3PIcPUIAKrNHKBK1qclUY95hdxlcS9L yUxqWI2tBjnH484IvNSLJKlSyfhWDiGDj3bI1Sbt+g7MSlJ0h3vG5nuDeH5X01wM 3bQ4gVkPqdpwgg57dANpp81zeT7OiiuTkivB9vQKtALYv7oVOwOP4/M2Lrv5ag0H 5eG/ukl1owHPApdDMwrROnsZeK1z8kpRHlEf7svwCw7CVMXTBDusuqJjsGyC69xI ODMOOV2UtplwagpsUfQW8nOMwx4XoJEuwi4zOYFSwrrGu+w/EWQsNSROEERvkGhU nGxyslhX+mU0O9V2laePy+FPfxZXFYR3HYhvZtMXybh7ky9piO1zWGEohGFM5zk= =oeeC -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--