From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51668 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFOlI-0003zF-UZ for qemu-devel@nongnu.org; Fri, 21 May 2010 05:44:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFOkb-0006uU-F1 for qemu-devel@nongnu.org; Fri, 21 May 2010 05:43:24 -0400 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:54383) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFOkX-0006tc-3S for qemu-devel@nongnu.org; Fri, 21 May 2010 05:42:41 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o4L9gZUQ005774 for ; Fri, 21 May 2010 09:42:35 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4L9gZ3m1228966 for ; Fri, 21 May 2010 10:42:35 +0100 Received: from d06av03.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o4L9gY5G004361 for ; Fri, 21 May 2010 10:42:34 +0100 From: Stefan Hajnoczi Date: Fri, 21 May 2010 10:42:25 +0100 Message-Id: <1274434947-2863-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 0/2] Tracing List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kvm@vger.kernel.org Cc: Anthony Liguori , Prerna Saxena Trace events in QEMU/KVM can be very useful for debugging and performance analysis. I'd like to discuss tracing support and hope others have an interest in this feature, too. Following this email are patches I am using to debug virtio-blk and storage. The patches provide trivial tracing support, but they don't address the details of real tracing tools: enabling/disabling events at runtime, no overhead for disabled events, multithreading support, etc. It would be nice to have userland tracing facilities that work out-of-the-box on production systems. Unfortunately, I'm not aware of any such facilities out there right now on Linux. Perhaps SystemTap userspace tracing is the way to go, has anyone tried it with KVM? For the medium term, without userspace tracing facilities in the OS we could put something into QEMU to address the need for tracing. Here are my thoughts on fleshing out the tracing patch I have posted: 1. Make it possible to enable/disable events at runtime. Users enable only the events they are interested in and aren't flooded with trace data for all other events. 2. Either make trace events cheap or build without trace events by default. Disable by default still allows tracing to be used for development but less for production. 3. Allow events in any execution context (cpu, io, aio emulation threads). The current code does not support concurrency and is meant for when the iothread mutex is held. 4. Make it easy to add new events. Instead of keeping trace.h and trace.py in sync manually, use something like .hx to produce the appropriate C and Python. Summary: Tracing is useful, are there external tools we can use right now? If not, should we put in something that works well enough until external tools catch up? Stefan