Skip to contentSkip to conversation

xentrace_format supports a system that has more than 8 CPUs

PATCH New KUWAMURA Shin'ya 1 participant 1 message May 19, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xentrace_format supports a system that has more than 8 CPUs

Hi, all

I ran xentrace_format on a machine of 16 CPUs and got the following error message:

Traceback (most recent call last):
File "/usr/bin/xentrace_format", line 114, in ?
if tsc < last_tsc[cpu]:
IndexError: list index out of range

This patch fixes this problem and remove the limit of #CPU in xentrace_format.

Thanks,
-- KUWAMURA Shin'ya

tools/xentrace/xentrace_format +4 -2
diff -r d2f6e3d70f22 tools/xentrace/xentrace_format
@@ -89,7 +89,7 @@ CPUREC = "I"
 CPUREC = "I"
 TRCREC = "QLLLLLL"
 
-last_tsc = [0,0,0,0,0,0,0,0]
+last_tsc = [0]
 
 i=0
 
@@ -111,7 +111,9 @@ while not interrupted:
 
 	#print i, tsc
 
-	if tsc < last_tsc[cpu]:
+        if cpu >= len(last_tsc):
+            last_tsc += [0] * (cpu - len(last_tsc) + 1)
+	elif tsc < last_tsc[cpu]:
 	    print "TSC stepped backward cpu %d !  %d %d" % (cpu,tsc,last_tsc[cpu])
 
 	last_tsc[cpu] = tsc

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel