Received: from eggs.gnu.org ([2001:4830:134:3::10]:33474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSogy-0008KN-Or for qemu-devel@nongnu.org; Mon, 08 Feb 2016 11:29:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSogv-0006Qb-HK for qemu-devel@nongnu.org; Mon, 08 Feb 2016 11:29:36 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:35245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSogv-0006QT-4L for qemu-devel@nongnu.org; Mon, 08 Feb 2016 11:29:33 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <5696D9FE.9060409@mentor.com> <20160208153014.GD31586@stefanha-x1.localdomain> Date: Mon, 08 Feb 2016 17:29:28 +0100 In-Reply-To: <20160208153014.GD31586@stefanha-x1.localdomain> (Stefan Hajnoczi's message of "Mon, 8 Feb 2016 15:30:14 +0000") Message-ID: <87k2mfp3mf.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] trace: timestamps, core IDs, and file creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Hollis Blanchard , QEMU Developers Stefan Hajnoczi writes: > On Wed, Jan 13, 2016 at 03:13:02PM -0800, Hollis Blanchard wrote: >> Hi Stefan, I've been starting to use qemu tracing and found it quite use= ful. >> I have a couple comments about the trace events in general: > Sorry for the late reply. >> The event timestamps are host time (get_clock()). I'm correlating qemu >> events with other logs (using icount), so host time is unhelpful. Could = we >> use cpu_get_clock() instead? (Trace events are used in other tools like >> qemu-io, where guest time doesn't exist, and there we could continue to = use >> get_clock().) > It must be possible to trace code while the guest CPUs are stopped, so > cpu_get_clock() on own breaks existing users. > If the CPU clock is more convenient for you, perhaps you can add an > option to use that clocksource? Hmmmm, what about abusing the "vcpu" event property I sent to automatically= emit the vCPU icount? We could make that a compile-time option. This also makes = me think that the print format for the vCPU can be auto-generated by tracetool= (it must now be set explicitly), so that what's printed can be easily interchan= ged. We can make that a follow-up series. >> When trying to understand multi-core guest behavior, it's pretty importa= nt >> to know which core is performing the traced action (e.g. MMIO). Would it >> make sense to automatically embed the core index, like the timestamp, or= do >> you think it should be encoded in each individual tracepoint? > I think that Llu=C3=ADs has some of this stuff automated in his TCG traci= ng > work. He has added special trace event types for TCG that can be > planted at code generation time as well as TB execution time. They can > include the vcpu number automatically IIRC. Yup, that's the last series I sent, which hasn't been reviewed yet: https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05996.html If any event (including outside tcg code) has a pointer to the "guilty" vCP= U, support for showing the vCPU can be easily added. > Regarding I/O emulation, we have to be careful because architecturally > some types of devices (e.g. PCI devices) don't have the concept of which > core is performing an action. QEMU takes advantage of that with > ioeventfd where a lightweight vmexit simply marks an eventfd file > descriptor readable in the kernel and quickly returns back to vcpu > execution. Another QEMU thread monitors the eventfd and processes the > notification and there is no concept of the current vcpu at that point. > It might be easiest to include the vcpu id in the trace event explicitly > for now. See the two responses above. Cheers, Lluis