From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kazuya Saito Subject: [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints Date: Fri, 29 Mar 2013 13:27:05 +0900 Message-ID: <51551819.7050800@jp.fujitsu.com> References: <51551779.9060403@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , "aliguori@us.ibm.com" , "stefanha@linux.vnet.ibm.com" , "kvm@vger.kernel.org" To: "qemu-devel@nongnu.org" Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:34009 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895Ab3C2E1T (ORCPT ); Fri, 29 Mar 2013 00:27:19 -0400 Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 17EA93EE0C1 for ; Fri, 29 Mar 2013 13:27:18 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id B1CED45DEBB for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 8DC7645DEB2 for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 81B6A1DB803C for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from g01jpexchkw09.g01.fujitsu.local (g01jpexchkw09.g01.fujitsu.local [10.0.194.48]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 368D71DB8038 for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) In-Reply-To: <51551779.9060403@jp.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: This patch adds tracepoints at ioctl to kvm. Tracing these ioctl is useful for clarification whether the cause of troubles is qemu or kvm. Signed-off-by: Kazuya Saito --- kvm-all.c | 4 ++++ trace-events | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 9b433d3..fdb099c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -33,6 +33,7 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "qemu/event_notifier.h" +#include "trace.h" /* This check must be after config-host.h is included */ #ifdef CONFIG_EVENTFD @@ -1634,6 +1635,7 @@ int kvm_ioctl(KVMState *s, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_ioctl(type, arg); ret = ioctl(s->fd, type, arg); if (ret == -1) { ret = -errno; @@ -1651,6 +1653,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_vm_ioctl(type, arg); ret = ioctl(s->vmfd, type, arg); if (ret == -1) { ret = -errno; @@ -1668,6 +1671,7 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg); ret = ioctl(cpu->kvm_fd, type, arg); if (ret == -1) { ret = -errno; diff --git a/trace-events b/trace-events index 7f34112..3023744 100644 --- a/trace-events +++ b/trace-events @@ -1101,3 +1101,8 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev # migration.c migrate_set_state(int new_state) "new state %d" + +# kvm-all.c +kvm_ioctl(int type, void *arg) "type %d, arg %p" +kvm_vm_ioctl(int type, void *arg) "type %d, arg %p" +kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p" -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULQuP-0005Ym-2p for qemu-devel@nongnu.org; Fri, 29 Mar 2013 00:27:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULQuM-00086r-7j for qemu-devel@nongnu.org; Fri, 29 Mar 2013 00:27:21 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:58999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULQuL-00086l-Na for qemu-devel@nongnu.org; Fri, 29 Mar 2013 00:27:18 -0400 Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id C05923EE0B6 for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id A98FC45DDCF for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 8DCEF45DD78 for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 819061DB803A for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Received: from g01jpexchkw09.g01.fujitsu.local (g01jpexchkw09.g01.fujitsu.local [10.0.194.48]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 3DDD11DB8038 for ; Fri, 29 Mar 2013 13:27:16 +0900 (JST) Message-ID: <51551819.7050800@jp.fujitsu.com> Date: Fri, 29 Mar 2013 13:27:05 +0900 From: Kazuya Saito MIME-Version: 1.0 References: <51551779.9060403@jp.fujitsu.com> In-Reply-To: <51551779.9060403@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: Paolo Bonzini , "aliguori@us.ibm.com" , "stefanha@linux.vnet.ibm.com" , "kvm@vger.kernel.org" This patch adds tracepoints at ioctl to kvm. Tracing these ioctl is useful for clarification whether the cause of troubles is qemu or kvm. Signed-off-by: Kazuya Saito --- kvm-all.c | 4 ++++ trace-events | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 9b433d3..fdb099c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -33,6 +33,7 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "qemu/event_notifier.h" +#include "trace.h" /* This check must be after config-host.h is included */ #ifdef CONFIG_EVENTFD @@ -1634,6 +1635,7 @@ int kvm_ioctl(KVMState *s, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_ioctl(type, arg); ret = ioctl(s->fd, type, arg); if (ret == -1) { ret = -errno; @@ -1651,6 +1653,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_vm_ioctl(type, arg); ret = ioctl(s->vmfd, type, arg); if (ret == -1) { ret = -errno; @@ -1668,6 +1671,7 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) arg = va_arg(ap, void *); va_end(ap); + trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg); ret = ioctl(cpu->kvm_fd, type, arg); if (ret == -1) { ret = -errno; diff --git a/trace-events b/trace-events index 7f34112..3023744 100644 --- a/trace-events +++ b/trace-events @@ -1101,3 +1101,8 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev # migration.c migrate_set_state(int new_state) "new state %d" + +# kvm-all.c +kvm_ioctl(int type, void *arg) "type %d, arg %p" +kvm_vm_ioctl(int type, void *arg) "type %d, arg %p" +kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p" -- 1.7.1