Received: from eggs.gnu.org ([2001:4830:134:3::10]:50333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL8PK-0006gv-Or for qemu-devel@nongnu.org; Mon, 18 Jan 2016 06:55:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL8PF-00009d-PI for qemu-devel@nongnu.org; Mon, 18 Jan 2016 06:55:38 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:39175 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL8PF-00008y-DO for qemu-devel@nongnu.org; Mon, 18 Jan 2016 06:55:33 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <145287587081.11400.4178335509020334684.stgit@localhost> <145287591675.11400.12508957244344480632.stgit@localhost> <569CC38F.60302@redhat.com> Date: Mon, 18 Jan 2016 12:55:21 +0100 Message-ID: <874mebp0eu.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 8/9] 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: Paolo Bonzini Cc: Eduardo Habkost , Peter Crosthwaite , Stefan Hajnoczi , Riku Voipio , qemu-devel@nongnu.org, Markus Armbruster , Blue Swirl , Stefan Hajnoczi , Luiz Capitulino , Andreas =?utf-8?Q?F=C3=A4rber?= , Richard Henderson Paolo Bonzini writes: > On 15/01/2016 17:38, Llu=C3=ADs Vilanova wrote: >> Each event with the 'vcpu' property gets a per-vCPU dynamic tracing stat= e. >>=20 >> The set of enabled events with the 'vcpu' and 'tcg' properties is used >> to select a per-vCPU physical TB cache. The number of events with both >> properties is used to select the number of physical TB caches, and a >> bitmap of the identifiers of such enabled events is used to select a >> physical TB cache. >>=20 >> Signed-off-by: Llu=C3=ADs Vilanova > I may be wrong, but this patch and patches 3+5 seem overengineered. Why > can't you just flush the TB cache entirely whenever the set of trace > events changes, independent of whether they use the vcpu attribute? > That's a very rare event. A request for this was discussed some time ago, while the current simple ve= rsion was merged. Right now, an event is enabled for al vCPUs. This series allows enabling events on a per-vCPU basis (e.g., trace memory accesses of a speci= fic vCPU, or with the necessary logic, trace a specific guest process). This series contains three different new features that are closely related: * Identify the guest vCPU that is generating an event (when it has the 'vcp= u' property). * Set dynamic event state on a per-vCPU basis (when it has the 'tcg' and 'v= cpu' properties). * Use a different virtual TB cache for each vCPU, so that they can efficien= tly share TBs. If vCPUs have different events enabled, those with the disabled events won't pay for the extra tracing code generated in the TB. Would it be better to split these into three separate series? It would prob= ably make reviewing more manageable. Also, I have more patches on my queue to start adding meaningful guest code events (memory access and instruction traces), but they depend on this new 'vcpu' property. Thanks, Lluis