aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-05-19 02:08:01 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-05-19 02:08:01 +0100
commit2e1b6a8dcc022cbf84fa22e5e1f47bef63a68cb1 (patch)
treee52d8dedd255667a82d60c417d9333327cebe46a /tools/xentrace
parentf770d340f1380e924a1cdc201d3872306d263945 (diff)
downloadxen-2e1b6a8dcc022cbf84fa22e5e1f47bef63a68cb1.tar.gz
xen-2e1b6a8dcc022cbf84fa22e5e1f47bef63a68cb1.tar.bz2
xen-2e1b6a8dcc022cbf84fa22e5e1f47bef63a68cb1.zip
xentrace: Trace IRQs and entry/exit timestamps.
From: Dulloor <dulloor@gmail.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/formats1
-rw-r--r--tools/xentrace/xentrace_format17
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 617e4745ad..5b2a7693d1 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -3,6 +3,7 @@
0x0001f001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) lost_records 0x%(1)08x
0x0001f002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) wrap_buffer 0x%(1)08x
0x0001f003 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) cpu_change 0x%(1)08x
+0x0001f004 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) trace_irq [ vector = %(1)d, count = %(2)d, tot_cycles = 0x%(3)08x, max_cycles = 0x%(4)08x ]
0x00021011 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) running_to_runnable [ dom:vcpu = 0x%(1)08x ]
0x00021021 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) running_to_blocked [ dom:vcpu = 0x%(1)08x ]
diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format
index f0127309ab..e13b05b734 100644
--- a/tools/xentrace/xentrace_format
+++ b/tools/xentrace/xentrace_format
@@ -110,6 +110,10 @@ D7REC = "IIIIIII"
last_tsc = [0]
+TRC_TRACE_IRQ = 0x1f004
+NR_VECTORS = 256
+irq_measure = [{'count':0, 'tot_cycles':0, 'max_cycles':0}] * NR_VECTORS
+
i=0
while not interrupted:
@@ -179,6 +183,19 @@ while not interrupted:
if event == 0x1f003:
cpu = d1
+ if event == TRC_TRACE_IRQ:
+ # IN - d1:vector, d2:tsc_in, d3:tsc_out
+ # OUT - d1:vector, d2:count, d3:tot_cycles, d4:max_cycles
+ tsc_diff = d3 - d2
+ if tsc_diff < 0:
+ break
+ irq_measure[d1]['count'] += 1
+ irq_measure[d1]['tot_cycles'] += tsc_diff
+ if irq_measure[d1]['max_cycles'] < tsc_diff:
+ irq_measure[d1]['max_cycles'] = tsc_diff
+ d2 = irq_measure[d1]['count']
+ d3 = irq_measure[d1]['tot_cycles']
+ d4 = irq_measure[d1]['max_cycles']
#tsc = (tscH<<32) | tscL