qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles
@ 2013-03-29  4:24 Kazuya Saito
  2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints Kazuya Saito
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kazuya Saito @ 2013-03-29  4:24 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: Paolo Bonzini, aliguori, stefanha, kvm

This series adds tracepoints for helping us clarify the cause of
troubles. Virtualization on Linux is composed of some components such
as qemu, kvm, libvirt, and so on. So it is very important to clarify
firstly and swiftly the cause of troubles is on what component of
them. Although qemu has useful information of this because it stands
among kvm, libvirt and guest, it doesn't output the information by
trace or log system.
These patches add tracepoints which lead to reduce the time of the
clarification. We'd like to add the tracepoints as the first set
because, based on our experience, we've found out they must be useful
for an investigation in the future. Without those tracepoints,
we had a really hard time investigating a problem since the problem's
reproducibility was quite low and there was no clue in the dump of
qemu.

Changes from v1:
Add arg to kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints.
Add cpu_index to kvm_vcpu_ioctl, kvm_run_exit tracepoints.

Kazuya Saito (2):
  kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints
  kvm-all: add kvm_run_exit tracepoint

 kvm-all.c    |    5 +++++
 trace-events |    7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints
  2013-03-29  4:24 [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Kazuya Saito
@ 2013-03-29  4:27 ` Kazuya Saito
  2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 2/2] kvm-all: add kvm_run_exit tracepoint Kazuya Saito
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kazuya Saito @ 2013-03-29  4:27 UTC (permalink / raw)
  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 <saito.kazuya@jp.fujitsu.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH uq/master v2 2/2] kvm-all: add kvm_run_exit tracepoint
  2013-03-29  4:24 [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Kazuya Saito
  2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints Kazuya Saito
@ 2013-03-29  4:27 ` Kazuya Saito
  2013-03-29  8:09 ` [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Paolo Bonzini
  2013-04-08 15:48 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Kazuya Saito @ 2013-03-29  4:27 UTC (permalink / raw)
  To: qemu-devel@nongnu.org
  Cc: Paolo Bonzini, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com,
	kvm@vger.kernel.org

This patch enable us to know exit reason of KVM_RUN. It will help us
know where the trouble is caused.

Signed-off-by: Kazuya Saito <saito.kazuya@jp.fujitsu.com>
---
 kvm-all.c    |    1 +
 trace-events |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index fdb099c..325f5e7 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1574,6 +1574,7 @@ int kvm_cpu_exec(CPUArchState *env)
             abort();
         }

+        trace_kvm_run_exit(cpu->cpu_index, run->exit_reason);
         switch (run->exit_reason) {
         case KVM_EXIT_IO:
             DPRINTF("handle_io\n");
diff --git a/trace-events b/trace-events
index 3023744..8fd6e80 100644
--- a/trace-events
+++ b/trace-events
@@ -1106,3 +1106,5 @@ migrate_set_state(int new_state) "new state %d"
 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"
+kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
+
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles
  2013-03-29  4:24 [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Kazuya Saito
  2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints Kazuya Saito
  2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 2/2] kvm-all: add kvm_run_exit tracepoint Kazuya Saito
@ 2013-03-29  8:09 ` Paolo Bonzini
  2013-04-08 15:48 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-03-29  8:09 UTC (permalink / raw)
  To: Kazuya Saito; +Cc: aliguori, qemu-devel@nongnu.org, kvm, stefanha

Il 29/03/2013 05:24, Kazuya Saito ha scritto:
> This series adds tracepoints for helping us clarify the cause of
> troubles. Virtualization on Linux is composed of some components such
> as qemu, kvm, libvirt, and so on. So it is very important to clarify
> firstly and swiftly the cause of troubles is on what component of
> them. Although qemu has useful information of this because it stands
> among kvm, libvirt and guest, it doesn't output the information by
> trace or log system.
> These patches add tracepoints which lead to reduce the time of the
> clarification. We'd like to add the tracepoints as the first set
> because, based on our experience, we've found out they must be useful
> for an investigation in the future. Without those tracepoints,
> we had a really hard time investigating a problem since the problem's
> reproducibility was quite low and there was no clue in the dump of
> qemu.
> 
> Changes from v1:
> Add arg to kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints.
> Add cpu_index to kvm_vcpu_ioctl, kvm_run_exit tracepoints.
> 
> Kazuya Saito (2):
>   kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints
>   kvm-all: add kvm_run_exit tracepoint
> 
>  kvm-all.c    |    5 +++++
>  trace-events |    7 +++++++
>  2 files changed, 12 insertions(+), 0 deletions(-)

Series:

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles
  2013-03-29  4:24 [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Kazuya Saito
                   ` (2 preceding siblings ...)
  2013-03-29  8:09 ` [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Paolo Bonzini
@ 2013-04-08 15:48 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-04-08 15:48 UTC (permalink / raw)
  To: Kazuya Saito
  Cc: Paolo Bonzini, aliguori, qemu-devel@nongnu.org, kvm, stefanha

On Fri, Mar 29, 2013 at 01:24:25PM +0900, Kazuya Saito wrote:
> This series adds tracepoints for helping us clarify the cause of
> troubles. Virtualization on Linux is composed of some components such
> as qemu, kvm, libvirt, and so on. So it is very important to clarify
> firstly and swiftly the cause of troubles is on what component of
> them. Although qemu has useful information of this because it stands
> among kvm, libvirt and guest, it doesn't output the information by
> trace or log system.
> These patches add tracepoints which lead to reduce the time of the
> clarification. We'd like to add the tracepoints as the first set
> because, based on our experience, we've found out they must be useful
> for an investigation in the future. Without those tracepoints,
> we had a really hard time investigating a problem since the problem's
> reproducibility was quite low and there was no clue in the dump of
> qemu.
> 
> Changes from v1:
> Add arg to kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints.
> Add cpu_index to kvm_vcpu_ioctl, kvm_run_exit tracepoints.
> 
> Kazuya Saito (2):
>   kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints
>   kvm-all: add kvm_run_exit tracepoint
> 
>  kvm-all.c    |    5 +++++
>  trace-events |    7 +++++++
>  2 files changed, 12 insertions(+), 0 deletions(-)
> 
> 
> 

Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-08 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29  4:24 [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Kazuya Saito
2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 1/2] kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints Kazuya Saito
2013-03-29  4:27 ` [Qemu-devel] [PATCH uq/master v2 2/2] kvm-all: add kvm_run_exit tracepoint Kazuya Saito
2013-03-29  8:09 ` [Qemu-devel] [PATCH uq/master v2 0/2] Add some tracepoints for clarification of the cause of troubles Paolo Bonzini
2013-04-08 15:48 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).