]> xenbits.xensource.com Git - xenalyze.git/commitdiff
[global] process_lost_records doesn't assume p..current origin/xs5.0
authorGeorge Dunlap <gdunlap@gdunlap-desktop.(none)>
Mon, 27 Oct 2008 16:39:33 +0000 (16:39 +0000)
committerGeorge Dunlap <gdunlap@gdunlap-desktop.(none)>
Mon, 27 Oct 2008 16:40:20 +0000 (16:40 +0000)
analyze.c

index 8148ca476732171a67da64c348dfa30c11e369e0..d4950fef0f8f65b9e298a5dfcc877943d2b8083f 100644 (file)
--- a/analyze.c
+++ b/analyze.c
@@ -6479,11 +6479,17 @@ void process_lost_records(struct pcpu_info *p)
 
     if(opt.dump_cooked || opt.dump_all)
     {
-        printf(" %s lost_records count %d d%uv%u (cur d%dv%d) first_tsc %lld\n",
-               ri->dump_header, r->lost_records,
-               r->did, r->vid,
-               p->current->d->did, p->current->vid,
-               r->first_tsc);
+        if(p->current)
+            printf(" %s lost_records count %d d%uv%u (cur d%dv%d) first_tsc %lld\n",
+                   ri->dump_header, r->lost_records,
+                   r->did, r->vid,
+                   p->current->d->did, p->current->vid,
+                   r->first_tsc);
+        else
+            printf(" %s lost_records count %d d%uv%u (cur X) first_tsc %lld\n",
+                   ri->dump_header, r->lost_records,
+                   r->did, r->vid,
+                   r->first_tsc);
     }
 
 #if 0
@@ -6491,20 +6497,22 @@ void process_lost_records(struct pcpu_info *p)
         volume_summary(&p->volume.last_buffer);
 #endif
 
-    clear_vlapic(&p->current->vlapic);
-    if(p->current->data_type == VCPU_DATA_HVM) {
-        p->current->hvm.vmexit_valid=0;
-        cr3_switch(0, &p->current->hvm);
-    }
-
-    /* We may lose scheduling records; so we need to:
-     * - Point all records until now to the next schedule in the
-     * "default" domain
-     * - Make sure there are no warnings / strangeness with the
-     * current vcpu (if it gets scheduled elsewhere).
-     */
-    vcpu_prev_update(p, p->current, first_tsc, RUNSTATE_LOST);
+    if ( p->current ) {
+    
+        clear_vlapic(&p->current->vlapic);
+        if(p->current->data_type == VCPU_DATA_HVM) {
+            p->current->hvm.vmexit_valid=0;
+            cr3_switch(0, &p->current->hvm);
+        }
 
+        /* We may lose scheduling records; so we need to:
+         * - Point all records until now to the next schedule in the
+         * "default" domain
+         * - Make sure there are no warnings / strangeness with the
+         * current vcpu (if it gets scheduled elsewhere).
+         */
+        vcpu_prev_update(p, p->current, first_tsc, RUNSTATE_LOST);
+    }
 #if 0
     vcpu_next_update(p, default_domain.vcpu[p->pid], first_tsc);
     if(p->current->data_type == VCPU_DATA_HVM) {