[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 8 of 8] xenalyze: Get rid of redundant hvm dump_header
No need to have a second dump_header. Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx> diff -r f86ebfe66384 -r 84d9c7ac3cbf xenalyze.c --- a/xenalyze.c Thu Jan 26 17:18:13 2012 +0000 +++ b/xenalyze.c Thu Jan 26 17:18:43 2012 +0000 @@ -1435,7 +1435,6 @@ struct hvm_data { tsc_t exit_tsc, arc_cycles, entry_tsc; unsigned long long rip; unsigned exit_reason, event_handler; - char dump_header[256]; int short_summary_done:1, prealloc_unpin:1, wrmap_bf:1; /* Immediate processing */ @@ -3800,11 +3799,11 @@ void hvm_mmio_assist_process(struct reco { if(m->data_valid) printf("]%s mmio_assist %c gpa %llx data %x\n", - h->dump_header, + ri->dump_header, mevt.write?'w':'r', m->gpa, m->data); else - printf("]%s mmio_assist %c gpa %llx (no data)\n", h->dump_header, + printf("]%s mmio_assist %c gpa %llx (no data)\n", ri->dump_header, mevt.write?'w':'r', m->gpa); } @@ -3995,7 +3994,7 @@ void hvm_io_assist_process(struct record if(opt.dump_all) { printf(" %s io %s port %x val %x\n", - h->dump_header, + ri->dump_header, mevt.write?"write":"read", r->x32.port, r->x32.data); @@ -4348,13 +4347,13 @@ void hvm_cr_write_process(struct record_ { if(cr == 3 && h->v->cr3.val) { printf("]%s cr_write cr3 val %llx oval %llx %s\n", - h->dump_header, + ri->dump_header, val, h->v->cr3.val, (h->v->cr3.val == val)?"flush":"switch"); } else { printf(" %s cr_write cr%d val %llx\n", - h->dump_header, + ri->dump_header, cr, val); } @@ -4392,7 +4391,7 @@ void hvm_msr_write_process(struct record if(opt.dump_all) { printf(" %s msr_write addr %x val %llx\n", - h->dump_header, + ri->dump_header, r->addr, r->val); } @@ -4430,7 +4429,7 @@ void hvm_msr_read_process(struct record_ if(opt.dump_all) { printf(" %s msr_read addr %x val %llx\n", - h->dump_header, + ri->dump_header, r->addr, r->val); } @@ -4476,12 +4475,12 @@ void hvm_vmcall_process(struct record_in if(opt.dump_all) { if(r->eax < HYPERCALL_MAX) printf(" %s vmcall %2x (%s)\n", - h->dump_header, + ri->dump_header, r->eax, hypercall_name[r->eax]); else printf(" %s vmcall %2x\n", - h->dump_header, + ri->dump_header, r->eax); } @@ -4534,7 +4533,7 @@ void hvm_intr_summary(struct hvm_data *h } -void hvm_intr_process(struct hvm_data *h) +void hvm_intr_process(struct record_info *ri, struct hvm_data *h) { unsigned vec = *(unsigned *)h->d; @@ -4558,12 +4557,12 @@ void hvm_intr_process(struct hvm_data *h if ( vec < EXTERNAL_INTERRUPT_MAX && hvm_extint_vector_name[vec] ) printf(" %s intr vec %s(%x)\n", - h->dump_header, + ri->dump_header, hvm_extint_vector_name[vec], vec); else printf(" %s intr vec %x\n", - h->dump_header, vec); + ri->dump_header, vec); } if(opt.scatterplot_interrupt_eip @@ -4695,7 +4694,7 @@ void hvm_npf_process(struct record_info if ( opt.dump_all ) printf(" %s npf gpa %llx q %x mfn %llx t %d\n", - h->dump_header, + ri->dump_header, (unsigned long long)r->gpa, r->qualification, (unsigned long long)r->mfn, r->p2mt); } @@ -4708,7 +4707,7 @@ void hvm_rdtsc_process(struct record_inf if ( opt.dump_all ) printf(" %s rdtsc %llx %lld %s\n", - h->dump_header, + ri->dump_header, (unsigned long long)r->tsc, (unsigned long long)r->tsc, h->last_rdtsc > r->tsc ? "BACKWARDS" : ""); @@ -4922,7 +4921,7 @@ needs_vmexit: switch(ri->event) { /* Records adding to the vmexit reason */ case TRC_HVM_INTR: - hvm_intr_process(h); + hvm_intr_process(ri, h); break; case TRC_HVM_PF_XEN: case TRC_HVM_PF_XEN64: @@ -5259,50 +5258,6 @@ void hvm_vmexit_process(struct record_in h->post_process = hvm_generic_postprocess; h->inflight.generic.event = 0; - - if ( opt.dump_all) { - struct time_struct t; - char * c; - int len, r; - - abs_cycles_to_time(h->exit_tsc, &t); - - len = DUMP_HEADER_MAX; - c = h->dump_header; - - if ( t.time ) - { - r=snprintf(c, len, "%3u.%09u", t.s, t.ns); - c+=r; - len-=r; - } - else - { - r=snprintf(c, - len, - " "); - c+=r; - len-=r; - } - - r = snprintf(c, len, " %s", pcpu_string(ri->cpu)); - c+=r; - len-=r; - - if ( v ) - { - r = snprintf(c, len, " d%dv%d", v->d->did, v->vid); - c+=r; - len-=r; - } - else - { - r = snprintf(c, len, " d?v?"); - c+=r; - len-=r; - } - - } } void hvm_close_vmexit(struct hvm_data *h, tsc_t tsc) { @@ -5844,7 +5799,7 @@ void shadow_unsync_process(struct record if(opt.dump_all) printf("]%s shadow unsync gmfn %llx va %llx pt_level %d corr %llx\n", - h->dump_header, + ri->dump_header, e->gmfn, e->va, e->pt_level, @@ -5873,7 +5828,7 @@ void shadow_emulate_other_process(struct if(opt.dump_all) printf("]%s shadow %s gfn %llx va %llx\n", - h->dump_header, + ri->dump_header, pf_xen_name[sevt.minor], e->gfn, e->va); @@ -6016,14 +5971,14 @@ void shadow_fixup_process(struct record_ { if ( e->flag_unsync ) printf("]%s fixup:unsync va %llx gl1e %llx corr %llx flags (%x)%s\n", - h->dump_header, + ri->dump_header, e->va, e->gl1e, e->corresponding_va, e->flags, flag_string(e)); else printf("]%s fixup va %llx gl1e %llx flags (%x)%s\n", - h->dump_header, + ri->dump_header, e->va, e->gl1e, e->flags, flag_string(e)); } @@ -6103,7 +6058,7 @@ void shadow_mmio_process(struct record_i if(opt.dump_all) printf("]%s %smmio va %llx\n", - h->dump_header, + ri->dump_header, (e->pf_case==PF_XEN_FAST_MMIO)?"fast ":"", e->va); @@ -6200,7 +6155,7 @@ void shadow_propagate_process(struct rec if(opt.dump_all) printf("]%s propagate va %llx gl1e %llx flags (%x)%s\n", - h->dump_header, + ri->dump_header, e->va, e->gl1e, e->flags, flag_string(e)); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |