[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Remove tabs from python scripts xenmon and xentrace_format.
# HG changeset patch # User Keir Fraser <keir@xxxxxxxxxxxxx> # Date 1191836878 -3600 # Node ID ff99e8da117f57f6fbda7d593f1638523865df0a # Parent 58db20a15687d0d0b39743123a1f5d0aece51f5a Remove tabs from python scripts xenmon and xentrace_format. Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx> --- tools/xenmon/xenmon.py | 14 ++++---- tools/xentrace/xentrace_format | 70 ++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff -r 58db20a15687 -r ff99e8da117f tools/xenmon/xenmon.py --- a/tools/xenmon/xenmon.py Mon Oct 08 10:46:45 2007 +0100 +++ b/tools/xenmon/xenmon.py Mon Oct 08 10:47:58 2007 +0100 @@ -310,10 +310,10 @@ def show_livestats(cpu): len = struct.calcsize(ST_DOM_INFO) dom = struct.unpack(ST_DOM_INFO, shm[idx:idx+len]) doms.append(dom) -# (last_update_time, start_time, runnable_start_time, blocked_start_time, -# ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update, -# runnable, in_use, domid, junk, name) = dom -# dom_in_use.append(in_use) +# (last_update_time, start_time, runnable_start_time, blocked_start_time, +# ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update, +# runnable, in_use, domid, junk, name) = dom +# dom_in_use.append(in_use) dom_in_use.append(dom[8]) domid = dom[9] if domid == 32767 : @@ -599,9 +599,9 @@ def writelog(): len = struct.calcsize(ST_DOM_INFO) dom = struct.unpack(ST_DOM_INFO, shm[idx:idx+len]) # doms.append(dom) -# (last_update_time, start_time, runnable_start_time, blocked_start_time, -# ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update, -# runnable, in_use, domid, junk, name) = dom +# (last_update_time, start_time, runnable_start_time, blocked_start_time, +# ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update, +# runnable, in_use, domid, junk, name) = dom dom_in_use.append(dom[8]) domid = dom[9] if domid == 32767: diff -r 58db20a15687 -r ff99e8da117f tools/xentrace/xentrace_format --- a/tools/xentrace/xentrace_format Mon Oct 08 10:46:45 2007 +0100 +++ b/tools/xentrace/xentrace_format Mon Oct 08 10:47:58 2007 +0100 @@ -43,14 +43,14 @@ def read_defs(defs_file): line = fd.readline() if not line: break - - if line[0] == '#' or line[0] == '\n': - continue - + + if line[0] == '#' or line[0] == '\n': + continue + m = reg.match(line) if not m: print >> sys.stderr, "Bad format file" ; sys.exit(1) - + defs[str(eval(m.group(1)))] = m.group(2) return defs @@ -70,7 +70,7 @@ try: opts, arg = getopt.getopt(sys.argv[1:], "c:" ) for opt in opts: - if opt[0] == '-c' : mhz = int(opt[1]) + if opt[0] == '-c' : mhz = int(opt[1]) except getopt.GetoptError: usage() @@ -108,7 +108,7 @@ i=0 while not interrupted: try: - i=i+1 + i=i+1 line = sys.stdin.read(struct.calcsize(HDRREC)) if not line: break @@ -121,7 +121,7 @@ while not interrupted: d3 = 0 d4 = 0 d5 = 0 - + tsc = 0 if tsc_in == 1: @@ -162,26 +162,26 @@ while not interrupted: cpu = d1 - #tsc = (tscH<<32) | tscL - - #print i, tsc + #tsc = (tscH<<32) | tscL + + #print i, tsc if cpu >= len(last_tsc): last_tsc += [0] * (cpu - len(last_tsc) + 1) - elif tsc < last_tsc[cpu] and tsc_in == 1: - print "TSC stepped backward cpu %d ! %d %d" % (cpu,tsc,last_tsc[cpu]) - - # provide relative TSC - if last_tsc[cpu] > 0 and tsc_in == 1: - reltsc = tsc - last_tsc[cpu] - else: - reltsc = 0 - - if tsc_in == 1: - last_tsc[cpu] = tsc - - if mhz: - tsc = tsc / (mhz*1000000.0) + elif tsc < last_tsc[cpu] and tsc_in == 1: + print "TSC stepped backward cpu %d ! %d %d" % (cpu,tsc,last_tsc[cpu]) + + # provide relative TSC + if last_tsc[cpu] > 0 and tsc_in == 1: + reltsc = tsc - last_tsc[cpu] + else: + reltsc = 0 + + if tsc_in == 1: + last_tsc[cpu] = tsc + + if mhz: + tsc = tsc / (mhz*1000000.0) args = {'cpu' : cpu, 'tsc' : tsc, @@ -193,15 +193,15 @@ while not interrupted: '4' : d4, '5' : d5 } - try: - - if defs.has_key(str(event)): - print defs[str(event)] % args - else: - if defs.has_key(str(0)): print defs[str(0)] % args - except TypeError: - print defs[str(event)] - print args - + try: + + if defs.has_key(str(event)): + print defs[str(event)] % args + else: + if defs.has_key(str(0)): print defs[str(0)] % args + except TypeError: + print defs[str(event)] + print args + except IOError, struct.error: sys.exit() _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |