All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events
@ 2014-06-21 18:43 Yang Zhiyong
  2014-06-27 11:39 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Zhiyong @ 2014-06-21 18:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, stefanha, yangzy.fnst

We have the experience that the guest doesn't stop successfully 
though it was instructed to shut down.

The root cause may be not in QEMU mostly.  However, QEMU is often
suspected at the beginning just because the issue occurred in
virtualization environment.

Therefore, we need to affirm that QEMU received the shutdown  
request and raised ACPI irq from "virsh shutdown" command, 
virt-manger or stopping QEMU process to the VM .
So that we can affirm the problems was belonged to the Guset OS 
rather than the QEMU itself.

When we stop guests by "virsh shutdown" command or virt-manger, 
or stopping QEMU process, qemu_system_powerdown_request() or
qemu_system_shutdown_request() is called. Then the below functions 
in main_loop_should_exit() of Vl.c are called roughly in the 
following order.
	
	if (qemu_powerdown_requested()) 
		qemu_system_powerdown()
			monitor_protocol_event(QEVENT_POWERDOWN, NULL)
		
	OR
	
	if(qemu_shutdown_requested()} 
		monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

The tracepoint of monitor_protocol_event() already exists, but no
tracepoints are defined for qemu_system_powerdown_request() and 
qemu_system_shutdown_request(). So this patch adds two tracepoints for 
the two functions. We believe that it will become much easier to 
isolate the problem mentioned above by these tracepoints.


Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com>

---
 trace-events |    2 ++
 vl.c         |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/trace-events b/trace-events
index 2c5b307..d642cc4 100644
--- a/trace-events
+++ b/trace-events
@@ -511,6 +511,8 @@ g_malloc(size_t size, void *ptr) "size %zu ptr %p"
 g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
 g_free(void *ptr) "ptr %p"
 system_wakeup_request(int reason) "reason=%d"
+qemu_system_shutdown_request(void) ""
+qemu_system_powerdown_request(void) ""
 
 # block/qcow2.c
 qcow2_writev_start_req(void *co, int64_t sector, int nb_sectors) "co %p sector %" PRIx64 " nb_sectors %d"
diff --git a/vl.c b/vl.c
index 709d8cd..aed0868 100644
--- a/vl.c
+++ b/vl.c
@@ -1982,6 +1982,7 @@ void qemu_system_killed(int signal, pid_t pid)
 
 void qemu_system_shutdown_request(void)
 {
+    trace_qemu_system_shutdown_request();
     shutdown_requested = 1;
     qemu_notify_event();
 }
@@ -1994,6 +1995,7 @@ static void qemu_system_powerdown(void)
 
 void qemu_system_powerdown_request(void)
 {
+    trace_qemu_system_powerdown_request();
     powerdown_requested = 1;
     qemu_notify_event();
 }
-- 
1.7.1

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

* Re: [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events
  2014-06-21 18:43 [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events Yang Zhiyong
@ 2014-06-27 11:39 ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-06-27 11:39 UTC (permalink / raw)
  To: Yang Zhiyong; +Cc: qemu-devel, aliguori

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

On Sun, Jun 22, 2014 at 02:43:03AM +0800, Yang Zhiyong wrote:
> We have the experience that the guest doesn't stop successfully 
> though it was instructed to shut down.
> 
> The root cause may be not in QEMU mostly.  However, QEMU is often
> suspected at the beginning just because the issue occurred in
> virtualization environment.
> 
> Therefore, we need to affirm that QEMU received the shutdown  
> request and raised ACPI irq from "virsh shutdown" command, 
> virt-manger or stopping QEMU process to the VM .
> So that we can affirm the problems was belonged to the Guset OS 
> rather than the QEMU itself.
> 
> When we stop guests by "virsh shutdown" command or virt-manger, 
> or stopping QEMU process, qemu_system_powerdown_request() or
> qemu_system_shutdown_request() is called. Then the below functions 
> in main_loop_should_exit() of Vl.c are called roughly in the 
> following order.
> 	
> 	if (qemu_powerdown_requested()) 
> 		qemu_system_powerdown()
> 			monitor_protocol_event(QEVENT_POWERDOWN, NULL)
> 		
> 	OR
> 	
> 	if(qemu_shutdown_requested()} 
> 		monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
> 
> The tracepoint of monitor_protocol_event() already exists, but no
> tracepoints are defined for qemu_system_powerdown_request() and 
> qemu_system_shutdown_request(). So this patch adds two tracepoints for 
> the two functions. We believe that it will become much easier to 
> isolate the problem mentioned above by these tracepoints.
> 
> 
> Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com>
> 
> ---
>  trace-events |    2 ++
>  vl.c         |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)

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

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events
  2014-06-11 14:42 Yang Zhiyong
@ 2014-06-23  1:19 ` yangzy.fnst
  0 siblings, 0 replies; 4+ messages in thread
From: yangzy.fnst @ 2014-06-23  1:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, mdroth, jforbes

Ping...

> -----Original Message-----
> From: Yang, Zhiyong/杨 志勇
> Sent: Wednesday, June 11, 2014 10:43 PM
> To: qemu-devel@nongnu.org
> Cc: Yang, Zhiyong/杨 志勇; peter.maydell@linaro.org;
> mdroth@linux.vnet.ibm.com; jforbes@redhat.com
> Subject: [Qemu-devel] [PATCH v1] trace: add
> qemu_system_powerdown_request and
> qemu_system_shutdown_request trace events
> 
> We have the experience that the guest doesn't stop successfully though it
> was instructed to shut down.
> 
> The root cause may be not in QEMU mostly.  However, QEMU is often
> suspected at the beginning just because the issue occurred in virtualization
> environment.
> 
> Therefore, we need to affirm that QEMU received the shutdown request
> and raised ACPI irq from "virsh shutdown" command, virt-manger or
> stopping QEMU process to the VM .
> So that we can affirm the problems was belonged to the Guset OS rather
> than the QEMU itself.
> 
> When we stop guests by "virsh shutdown" command or virt-manger, or
> stopping QEMU process, qemu_system_powerdown_request() or
> qemu_system_shutdown_request() is called. Then the below functions in
> main_loop_should_exit() of Vl.c are called roughly in the following order.
> 
> 	if (qemu_powerdown_requested())
> 		qemu_system_powerdown()
> 			monitor_protocol_event(QEVENT_POWERDOWN, NULL)
> 
> 	OR
> 
> 	if(qemu_shutdown_requested()}
> 		monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
> 
> The tracepoint of monitor_protocol_event() already exists, but no
> tracepoints are defined for qemu_system_powerdown_request() and
> qemu_system_shutdown_request(). So this patch adds two tracepoints
> for the two functions. We believe that it will become much easier to isolate
> the problem mentioned above by these tracepoints.
> 
> 
> Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com>
> 
> ---
>  trace-events |    2 ++
>  vl.c         |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/trace-events b/trace-events index 2c5b307..d642cc4 100644
> --- a/trace-events
> +++ b/trace-events
> @@ -511,6 +511,8 @@ g_malloc(size_t size, void *ptr) "size %zu ptr %p"
>  g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu
> newptr %p"
>  g_free(void *ptr) "ptr %p"
>  system_wakeup_request(int reason) "reason=%d"
> +qemu_system_shutdown_request(void) ""
> +qemu_system_powerdown_request(void) ""
> 
>  # block/qcow2.c
>  qcow2_writev_start_req(void *co, int64_t sector, int nb_sectors) "co %p
> sector %" PRIx64 " nb_sectors %d"
> diff --git a/vl.c b/vl.c
> index 709d8cd..aed0868 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1982,6 +1982,7 @@ void qemu_system_killed(int signal, pid_t pid)
> 
>  void qemu_system_shutdown_request(void)
>  {
> +    trace_qemu_system_shutdown_request();
>      shutdown_requested = 1;
>      qemu_notify_event();
>  }
> @@ -1994,6 +1995,7 @@ static void qemu_system_powerdown(void)
> 
>  void qemu_system_powerdown_request(void)
>  {
> +    trace_qemu_system_powerdown_request();
>      powerdown_requested = 1;
>      qemu_notify_event();
>  }
> --
> 1.7.1


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

* [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events
@ 2014-06-11 14:42 Yang Zhiyong
  2014-06-23  1:19 ` yangzy.fnst
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Zhiyong @ 2014-06-11 14:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, mdroth, jforbes, yangzy.fnst

We have the experience that the guest doesn't stop successfully 
though it was instructed to shut down.

The root cause may be not in QEMU mostly.  However, QEMU is often
suspected at the beginning just because the issue occurred in
virtualization environment.

Therefore, we need to affirm that QEMU received the shutdown  
request and raised ACPI irq from "virsh shutdown" command, 
virt-manger or stopping QEMU process to the VM .
So that we can affirm the problems was belonged to the Guset OS 
rather than the QEMU itself.

When we stop guests by "virsh shutdown" command or virt-manger, 
or stopping QEMU process,qemu_system_powerdown_request() or
qemu_system_shutdown_request() is called. Then the below functions 
in main_loop_should_exit() of Vl.c are called roughly in the 
following order.
	
	if (qemu_powerdown_requested()) 
		qemu_system_powerdown()
			monitor_protocol_event(QEVENT_POWERDOWN, NULL)
		
	OR
	
	if(qemu_shutdown_requested()} 
		monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

The tracepoint of monitor_protocol_event() already exists, but no
tracepoints are defined for qemu_system_powerdown_request() and 
qemu_system_shutdown_request(). So this patch adds two tracepoints for 
the two functions. We believe that it will become much easier to 
isolate the problem mentioned above by these tracepoints.


Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com>

---
 trace-events |    2 ++
 vl.c         |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/trace-events b/trace-events
index 2c5b307..d642cc4 100644
--- a/trace-events
+++ b/trace-events
@@ -511,6 +511,8 @@ g_malloc(size_t size, void *ptr) "size %zu ptr %p"
 g_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
 g_free(void *ptr) "ptr %p"
 system_wakeup_request(int reason) "reason=%d"
+qemu_system_shutdown_request(void) ""
+qemu_system_powerdown_request(void) ""
 
 # block/qcow2.c
 qcow2_writev_start_req(void *co, int64_t sector, int nb_sectors) "co %p sector %" PRIx64 " nb_sectors %d"
diff --git a/vl.c b/vl.c
index 709d8cd..aed0868 100644
--- a/vl.c
+++ b/vl.c
@@ -1982,6 +1982,7 @@ void qemu_system_killed(int signal, pid_t pid)
 
 void qemu_system_shutdown_request(void)
 {
+    trace_qemu_system_shutdown_request();
     shutdown_requested = 1;
     qemu_notify_event();
 }
@@ -1994,6 +1995,7 @@ static void qemu_system_powerdown(void)
 
 void qemu_system_powerdown_request(void)
 {
+    trace_qemu_system_powerdown_request();
     powerdown_requested = 1;
     qemu_notify_event();
 }
-- 
1.7.1

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

end of thread, other threads:[~2014-06-27 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 18:43 [Qemu-devel] [PATCH v1] trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events Yang Zhiyong
2014-06-27 11:39 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2014-06-11 14:42 Yang Zhiyong
2014-06-23  1:19 ` yangzy.fnst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.