From: George Dunlap Date: Mon, 27 Oct 2008 16:39:33 +0000 (+0000) Subject: [global] process_lost_records doesn't assume p..current X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fremotes%2Forigin%2Fxs5.0;p=xenalyze.git [global] process_lost_records doesn't assume p..current --- diff --git a/analyze.c b/analyze.c index 8148ca4..d4950fe 100644 --- 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) {