From patchwork Tue Nov 16 12:20:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 71388 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BC2C0B7129 for ; Tue, 16 Nov 2010 23:22:37 +1100 (EST) Received: from localhost ([127.0.0.1]:44978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIKYU-0007Bo-PS for incoming@patchwork.ozlabs.org; Tue, 16 Nov 2010 07:22:34 -0500 Received: from [140.186.70.92] (port=41829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIKWe-0006L6-GZ for qemu-devel@nongnu.org; Tue, 16 Nov 2010 07:20:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIKWd-0006bI-75 for qemu-devel@nongnu.org; Tue, 16 Nov 2010 07:20:40 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:57618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIKWc-0006ao-Ss for qemu-devel@nongnu.org; Tue, 16 Nov 2010 07:20:39 -0500 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oAGCKZXL004114 for ; Tue, 16 Nov 2010 12:20:35 GMT Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAGCKWuu3526710 for ; Tue, 16 Nov 2010 12:20:34 GMT Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAGCKWo9001682 for ; Tue, 16 Nov 2010 05:20:32 -0700 Received: from stefan-thinkpad.manchester-maybrook.uk.ibm.com (dyn-9-174-219-27.manchester-maybrook.uk.ibm.com [9.174.219.27]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oAGCKWCv001666; Tue, 16 Nov 2010 05:20:32 -0700 From: Stefan Hajnoczi To: Date: Tue, 16 Nov 2010 12:20:25 +0000 Message-Id: <1289910025-25448-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Stefan Hajnoczi , Prerna Saxena Subject: [Qemu-devel] [PATCH] trace: Trace vm_start()/vm_stop() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org VM state change notifications are invoked from vm_start()/vm_stop(). Trace these state changes so we can reason about the state of the VM from trace output. Signed-off-by: Stefan Hajnoczi --- trace-events | 3 +++ vl.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/trace-events b/trace-events index 947f8b0..da03d4b 100644 --- a/trace-events +++ b/trace-events @@ -189,3 +189,6 @@ disable sun4m_iommu_mem_writel_pgflush(uint32_t val) "page flush %x" disable sun4m_iommu_page_get_flags(uint64_t pa, uint64_t iopte, uint32_t ret) "get flags addr %"PRIx64" => pte %"PRIx64", *pte = %x" disable sun4m_iommu_translate_pa(uint64_t addr, uint64_t pa, uint32_t iopte) "xlate dva %"PRIx64" => pa %"PRIx64" iopte = %x" disable sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64"" + +# vl.c +disable vm_state_notify(int running, int reason) "running %d reason %d" diff --git a/vl.c b/vl.c index c58583d..87e76ad 100644 --- a/vl.c +++ b/vl.c @@ -158,6 +158,7 @@ int main(int argc, char **argv) #include "slirp/libslirp.h" +#include "trace.h" #include "qemu-queue.h" #include "cpus.h" #include "arch_init.h" @@ -1074,6 +1075,8 @@ void vm_state_notify(int running, int reason) { VMChangeStateEntry *e; + trace_vm_state_notify(running, reason); + for (e = vm_change_state_head.lh_first; e; e = e->entries.le_next) { e->cb(e->opaque, running, reason); }