[XEN] 'd' key dumps both host and guest state.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 12 Jan 2007 17:39:26 +0000 (17:39 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 12 Jan 2007 17:39:26 +0000 (17:39 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/keyhandler.c

index 3b5aeb05e2d121d6d645e7335c65949ad345f450..244273addfbbb6ae2935d0763cdceafb67b9a3e9 100644 (file)
@@ -95,6 +95,11 @@ static void show_handlers(unsigned char key)
 static void __dump_execstate(void *unused)
 {
     dump_execution_state();
+    printk("*** Dumping CPU%d guest state: ***\n", smp_processor_id());
+    if ( is_idle_vcpu(current) )
+        printk("No guest context (CPU is idle).\n");
+    else
+        show_execution_state(guest_cpu_user_regs());
 }
 
 static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
@@ -104,16 +109,18 @@ static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
     printk("'%c' pressed -> dumping registers\n", key);
 
     /* Get local execution state out immediately, in case we get stuck. */
-    printk("\n*** Dumping CPU%d state: ***\n", smp_processor_id());
-    show_execution_state(regs);
+    printk("\n*** Dumping CPU%d host state: ***\n", smp_processor_id());
+    __dump_execstate(NULL);
 
     for_each_online_cpu ( cpu )
     {
         if ( cpu == smp_processor_id() )
             continue;
-        printk("\n*** Dumping CPU%d state: ***\n", cpu);
+        printk("\n*** Dumping CPU%d host state: ***\n", cpu);
         on_selected_cpus(cpumask_of_cpu(cpu), __dump_execstate, NULL, 1, 1);
     }
+
+    printk("\n");
 }
 
 static void halt_machine(unsigned char key, struct cpu_user_regs *regs)