From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Date: Tue, 24 Jun 2008 20:49:23 +0000 Subject: Howto: Using KVM TRACE Message-Id: <1214340563.9192.23.camel@thinkpadL> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org This is a short HOWTO for using KVM TRACE. 1) Enable Kernel ======== Enable CONFIG_KVM_TRACE in your kernel config. You will enable CONFIG_MARKERS & CONFIG_SYSFS to enable. CONFIG_DEBUG_FS should be enabled once you enable KVM_TRACE. Build and boot. 2) Mount debugfs ======== You must mount debugfs before using kvmtrace. One way to do this is by placing an entry into your /etc/fstab , such as the following: debugfs /sys/kernel/debug debugfs defaults 0 0 Reboot and it will mounted. 3) Build kvmtrace tool =========== Go to kvm-userspace directory. Configure the directory with the configure command. Then go to "kvm-userspace/user" directory and type command: "make kvmtrace". This will build the trace tool you'll need to generate your trace file. Copy tool over to machine, so you can execute it later. 4) Running kvmtrace ==========Once on kvm host start a guest. To trace KVM use the kvmtrace tool, like in the following example. ./kvmtrace -o TRACE1 -w 5 This will run kvmtrace tool for 5 seconds and produce a binary file with your trace output named "TRACE1.kvmtrace.0". 5) Reading the data =========== Copy file with trace output to somewhere you can access. Go back into kvm-userspace/user directory. You will need two files: -kvmtrace_format -formats <-- file describes how to printout the kvmtrace events into a readable form Make sure your system has python. Now run kvmtrace_format like the following: cat TRACE1.kvmtrace.0 | ./kvmtrace_format formats You will then see your trace points displayed in a readable form.