xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH 8 of 8] xenalyze: Get rid of redundant hvm dump_header
Date: Thu, 26 Jan 2012 17:21:05 +0000	[thread overview]
Message-ID: <84d9c7ac3cbfe1c7aec3.1327598465@elijah> (raw)
In-Reply-To: <patchbomb.1327598457@elijah>

No need to have a second dump_header.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

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));

      parent reply	other threads:[~2012-01-26 17:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 17:20 [PATCH 0 of 8] xenalyze: Optimizations George Dunlap
2012-01-26 17:20 ` [PATCH 1 of 8] xenalyze: Improve record-sorting algorithm George Dunlap
2012-01-26 17:20 ` [PATCH 2 of 8] xenalyze: Remove spurious dump_header construction George Dunlap
2012-01-26 17:21 ` [PATCH 3 of 8] xenalyze: Remove --dump-cooked George Dunlap
2012-01-26 17:21 ` [PATCH 4 of 8] xenalyze: Enable -O2 optimization level George Dunlap
2012-01-26 17:21 ` [PATCH 5 of 8] xenalyze: Rework math to remove two 64-bit divisions George Dunlap
2012-01-26 17:21 ` [PATCH 6 of 8] xenalyze: Eliminate unnecessary cycles_to_time calculation George Dunlap
2012-01-26 17:21 ` [PATCH 7 of 8] xenalyze: Introduce more efficient read mechanism George Dunlap
2012-01-26 17:21 ` George Dunlap [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84d9c7ac3cbfe1c7aec3.1327598465@elijah \
    --to=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).