From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkWMU-000163-QO for qemu-devel@nongnu.org; Thu, 15 Sep 2016 09:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkWMO-0005GP-OL for qemu-devel@nongnu.org; Thu, 15 Sep 2016 09:05:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkWMO-0005Fs-Fd for qemu-devel@nongnu.org; Thu, 15 Sep 2016 09:05:48 -0400 Date: Thu, 15 Sep 2016 14:05:45 +0100 From: Stefan Hajnoczi Message-ID: <20160915130545.GA17714@stefanha-x1.localdomain> References: <147317195306.24754.2911961107337506103.stgit@fimbulvetr.bsc.es> <20160914144030.GG16438@stefanha-x1.localdomain> <87twdi5v3m.fsf@fimbulvetr.bsc.es> <20160915121031.GG4214@stefanha-x1.localdomain> <87r38lnx5c.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: <87r38lnx5c.fsf@fimbulvetr.bsc.es> Subject: Re: [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org, Peter Crosthwaite --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2016 at 02:51:59PM +0200, Llu=EDs Vilanova wrote: > Stefan Hajnoczi writes: >=20 > > On Wed, Sep 14, 2016 at 06:01:17PM +0200, Llu=EDs Vilanova wrote: > >> Stefan Hajnoczi writes: > >>=20 > >> > On Tue, Sep 06, 2016 at 04:25:53PM +0200, Llu=EDs Vilanova wrote: > >> >> +## vCPU > >> >> + > >> >> +# Create a new virtual (guest) CPU > >> >> +# > >> >> +# Targets: all > >> >> +guest_cpu_init(void *cpu) "cpu=3D%p" > >>=20 > >> > This isn't a vcpu trace event. Please add keep it with the other > >> > non-vcpu trace events: > >>=20 > >> > # cpus.c > >> > guest_cpu_init(void *cpu) "cpu=3D%p" > >>=20 > >> It actually is, but as the commit message says, declaring it as such p= revents > >> the event to be emitted. >=20 > > If it cannot be toggled on a per-vcpu basis then claiming it's a vcpu > > event doesn't make sense. >=20 > >> The culprit of this problem is that new vCPUs start with an empty per-= vCPU trace > >> event set. Should we make vCPUs "inherit" the state from the global st= ate? > >> (i.e., if any vcpu event is set on any vCPU, set it on the new one). T= he next > >> question would then be, should this inheritance only apply until traci= ng is > >> fully initialized of for the whole duration of QEMU? >=20 > > I think the underlying issue is that trace_init_vcpu_events() assumes > > there is a single instant where vcpus all exist and need to be > > initialized. >=20 > > A model that supports vcpu hotplug is really needed. In that model the > > global dstate should be the "global" state that determines whether vcpus > > are initialized with the event enabled or disabled. >=20 > Ok, so then you're going for what I was saying. "Inheriting" the state of= every > new vCPU from the global dynamic state. If *any* vCPU has an event enable= d, all > new vCPUs will too. No, I was thinking of something slightly different: Right now vcpu trace events use the global dstate during intialization only. After trace_init_vcpu_events() their dstate is zeroed. What if we leave the global dstate and use it as the template for enabling events in new vCPUs (hotplugged or static)? > As I said, next question is whether inheritance should apply only until f= ull > initialization, or the whole time. I thing the latter is less confusing. I agree that it should apply the whole time. --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJX2pypAAoJEJykq7OBq3PImWcIAKb6DTf0FdVqTtsVG14ku3d+ 33poXQQ7NY6DvOpxnTTET+vNvmslXADCzDr/DqPgb7GtLyRXMAbPyibxvB3wlVOa hUzSZOHQrAIrIpFbEUiUrv2vO38IAV727EpXehrWKp39wHqYkFFXbBqR2yeq9JI+ pyor2dHx3oE1KkPBuH7v2/5CBSYwfI/UPclmZ7Nvqt0k9XaTbcNfjqV3yXVWPDB6 2tY9fj7/dOFXEf5P5+Dfx7bvI0t2NJ4jlE6WxQh9EDOEVIdo6hni7+tVlV668l5O XXTQSAdxwQARgIMip6mgzDlOHtEtXoFIIubCPd0vS3wZ6Wlpn6f81GI4VNRzN3s= =B+EJ -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--