ia64/xen-unstable

changeset 16078:ff99e8da117f

Remove tabs from python scripts xenmon and xentrace_format.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir@xensource.com>
date Mon Oct 08 10:47:58 2007 +0100 (2007-10-08)
parents 58db20a15687
children 3d13b318349a
files tools/xenmon/xenmon.py tools/xentrace/xentrace_format
line diff
     1.1 --- a/tools/xenmon/xenmon.py	Mon Oct 08 10:46:45 2007 +0100
     1.2 +++ b/tools/xenmon/xenmon.py	Mon Oct 08 10:47:58 2007 +0100
     1.3 @@ -310,10 +310,10 @@ def show_livestats(cpu):
     1.4                  len = struct.calcsize(ST_DOM_INFO)
     1.5                  dom = struct.unpack(ST_DOM_INFO, shm[idx:idx+len])
     1.6                  doms.append(dom)
     1.7 -#		(last_update_time, start_time, runnable_start_time, blocked_start_time,
     1.8 -#		 ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update,
     1.9 -#		 runnable, in_use, domid, junk, name) = dom
    1.10 -#		dom_in_use.append(in_use)
    1.11 +#               (last_update_time, start_time, runnable_start_time, blocked_start_time,
    1.12 +#                ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update,
    1.13 +#                runnable, in_use, domid, junk, name) = dom
    1.14 +#               dom_in_use.append(in_use)
    1.15                  dom_in_use.append(dom[8])
    1.16                  domid = dom[9]
    1.17                  if domid == 32767 :
    1.18 @@ -599,9 +599,9 @@ def writelog():
    1.19                  len = struct.calcsize(ST_DOM_INFO)
    1.20                  dom = struct.unpack(ST_DOM_INFO, shm[idx:idx+len])
    1.21  #                doms.append(dom)
    1.22 -#		(last_update_time, start_time, runnable_start_time, blocked_start_time,
    1.23 -#		 ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update,
    1.24 -#		 runnable, in_use, domid, junk, name) = dom
    1.25 +#               (last_update_time, start_time, runnable_start_time, blocked_start_time,
    1.26 +#                ns_since_boot, ns_oncpu_since_boot, runnable_at_last_update,
    1.27 +#                runnable, in_use, domid, junk, name) = dom
    1.28                  dom_in_use.append(dom[8])
    1.29                  domid = dom[9]
    1.30                  if domid == 32767:
     2.1 --- a/tools/xentrace/xentrace_format	Mon Oct 08 10:46:45 2007 +0100
     2.2 +++ b/tools/xentrace/xentrace_format	Mon Oct 08 10:47:58 2007 +0100
     2.3 @@ -43,14 +43,14 @@ def read_defs(defs_file):
     2.4          line = fd.readline()
     2.5          if not line:
     2.6              break
     2.7 -	
     2.8 -	if line[0] == '#' or line[0] == '\n':
     2.9 -	    continue
    2.10 -        
    2.11 +
    2.12 +        if line[0] == '#' or line[0] == '\n':
    2.13 +            continue
    2.14 +
    2.15          m = reg.match(line)
    2.16  
    2.17          if not m: print >> sys.stderr, "Bad format file" ; sys.exit(1)
    2.18 -        
    2.19 +
    2.20          defs[str(eval(m.group(1)))] = m.group(2)
    2.21  
    2.22      return defs
    2.23 @@ -70,7 +70,7 @@ try:
    2.24      opts, arg = getopt.getopt(sys.argv[1:], "c:" )
    2.25  
    2.26      for opt in opts:
    2.27 -	if opt[0] == '-c' : mhz = int(opt[1])
    2.28 +        if opt[0] == '-c' : mhz = int(opt[1])
    2.29  
    2.30  except getopt.GetoptError:
    2.31      usage()
    2.32 @@ -108,7 +108,7 @@ i=0
    2.33  
    2.34  while not interrupted:
    2.35      try:
    2.36 -	i=i+1
    2.37 +        i=i+1
    2.38          line = sys.stdin.read(struct.calcsize(HDRREC))
    2.39          if not line:
    2.40              break
    2.41 @@ -121,7 +121,7 @@ while not interrupted:
    2.42          d3 = 0
    2.43          d4 = 0
    2.44          d5 = 0
    2.45 -  
    2.46 +
    2.47          tsc = 0
    2.48  
    2.49          if tsc_in == 1:
    2.50 @@ -162,26 +162,26 @@ while not interrupted:
    2.51              cpu = d1
    2.52  
    2.53  
    2.54 -	#tsc = (tscH<<32) | tscL
    2.55 +        #tsc = (tscH<<32) | tscL
    2.56  
    2.57 -	#print i, tsc
    2.58 +        #print i, tsc
    2.59  
    2.60          if cpu >= len(last_tsc):
    2.61              last_tsc += [0] * (cpu - len(last_tsc) + 1)
    2.62 -	elif tsc < last_tsc[cpu] and tsc_in == 1:
    2.63 -	    print "TSC stepped backward cpu %d !  %d %d" % (cpu,tsc,last_tsc[cpu])
    2.64 +        elif tsc < last_tsc[cpu] and tsc_in == 1:
    2.65 +            print "TSC stepped backward cpu %d !  %d %d" % (cpu,tsc,last_tsc[cpu])
    2.66  
    2.67 -	# provide relative TSC
    2.68 -	if last_tsc[cpu] > 0 and tsc_in == 1:
    2.69 -		reltsc = tsc - last_tsc[cpu]
    2.70 -	else:
    2.71 -		reltsc = 0
    2.72 +        # provide relative TSC
    2.73 +        if last_tsc[cpu] > 0 and tsc_in == 1:
    2.74 +            reltsc = tsc - last_tsc[cpu]
    2.75 +        else:
    2.76 +            reltsc = 0
    2.77  
    2.78 -	if tsc_in == 1:
    2.79 -	    last_tsc[cpu] = tsc
    2.80 +        if tsc_in == 1:
    2.81 +            last_tsc[cpu] = tsc
    2.82  
    2.83 -	if mhz:
    2.84 -	    tsc = tsc / (mhz*1000000.0)
    2.85 +        if mhz:
    2.86 +            tsc = tsc / (mhz*1000000.0)
    2.87  
    2.88          args = {'cpu'   : cpu,
    2.89                  'tsc'   : tsc,
    2.90 @@ -193,15 +193,15 @@ while not interrupted:
    2.91                  '4'     : d4,
    2.92                  '5'     : d5    }
    2.93  
    2.94 -	try:
    2.95 +        try:
    2.96  
    2.97 -	    if defs.has_key(str(event)): 
    2.98 -		print defs[str(event)] % args
    2.99 -	    else: 
   2.100 -		if defs.has_key(str(0)): print defs[str(0)] % args
   2.101 -	except TypeError:
   2.102 -	    print defs[str(event)]
   2.103 -	    print args
   2.104 -	    
   2.105 +            if defs.has_key(str(event)): 
   2.106 +                print defs[str(event)] % args
   2.107 +            else:
   2.108 +               if defs.has_key(str(0)): print defs[str(0)] % args
   2.109 +        except TypeError:
   2.110 +            print defs[str(event)]
   2.111 +            print args
   2.112 +
   2.113  
   2.114      except IOError, struct.error: sys.exit()