From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEqb-0006Aj-4R for qemu-devel@nongnu.org; Fri, 03 May 2013 08:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYEqZ-0007vA-7q for qemu-devel@nongnu.org; Fri, 03 May 2013 08:12:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59410 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEqY-0007u8-Ur for qemu-devel@nongnu.org; Fri, 03 May 2013 08:12:19 -0400 Message-ID: <5183A99E.1080801@suse.de> Date: Fri, 03 May 2013 14:12:14 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1367582485-15579-1-git-send-email-stefanha@redhat.com> <1367582485-15579-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1367582485-15579-2-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/4] 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: Stefan Hajnoczi Cc: Igor Mammedov , Anthony Liguori , qemu-devel@nongnu.org, Eduardo Habkost , Kazuya Saito Am 03.05.2013 14:01, schrieb Stefan Hajnoczi: > From: Kazuya Saito >=20 > This patch adds tracepoints at ioctl to kvm. Tracing these ioctl is > useful for clarification whether the cause of troubles is qemu or kvm. >=20 > Signed-off-by: Kazuya Saito > Reviewed-by: Paolo Bonzini > Signed-off-by: Stefan Hajnoczi > --- > kvm-all.c | 4 ++++ > trace-events | 5 +++++ > 2 files changed, 9 insertions(+) >=20 > diff --git a/kvm-all.c b/kvm-all.c > index f6c0f4a..4f73b98 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" > =20 > /* This check must be after config-host.h is included */ > #ifdef CONFIG_EVENTFD > @@ -1687,6 +1688,7 @@ int kvm_ioctl(KVMState *s, int type, ...) > arg =3D va_arg(ap, void *); > va_end(ap); > =20 > + trace_kvm_ioctl(type, arg); > ret =3D ioctl(s->fd, type, arg); > if (ret =3D=3D -1) { > ret =3D -errno; > @@ -1704,6 +1706,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) > arg =3D va_arg(ap, void *); > va_end(ap); > =20 > + trace_kvm_vm_ioctl(type, arg); > ret =3D ioctl(s->vmfd, type, arg); > if (ret =3D=3D -1) { > ret =3D -errno; > @@ -1721,6 +1724,7 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) > arg =3D va_arg(ap, void *); > va_end(ap); > =20 > + trace_kvm_vcpu_ioctl(cpu->cpu_index, type, arg); > ret =3D ioctl(cpu->kvm_fd, type, arg); > if (ret =3D=3D -1) { > ret =3D -errno; > diff --git a/trace-events b/trace-events > index 55e80be..d5bc7a5 100644 > --- a/trace-events > +++ b/trace-events > @@ -1153,3 +1153,8 @@ virtio_ccw_new_device(int cssid, int ssid, int sc= hid, int devno, const char *dev > =20 > # 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" Sorry that I'm just seeing this patch now (wasn't CC'ed), but I wonder whether cpu_index is the best thing to trace here? Can we still change trace event API or would we have to nack/change now? CC'ing Igor since he just introduced a cpu_get_arch_id() and there's also a kvm_arch_vcpu_id() introduced earlier by Eduardo. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg