Skip to content

Commit

Permalink
range Python 2 -> 3 compatibility (iovisor#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
r4f4 authored and goldshtn committed Mar 3, 2017
1 parent 1a1f441 commit d7a5ff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tools/cpuunclaimed.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@
if args.timestamp:
print("TIME", end=",")
print("TIMESTAMP_ns", end=",")
print(",".join("CPU" + str(c) for c in xrange(ncpu)), end="")
print(",".join("CPU" + str(c) for c in range(ncpu)), end="")
if args.fullcsv:
print(",", end="")
print(",".join("OFFSET_ns_CPU" + str(c) for c in xrange(ncpu)), end="")
print(",".join("OFFSET_ns_CPU" + str(c) for c in range(ncpu)), end="")
print()
else:
print(("Sampling run queues... Output every %s seconds. " +
Expand Down Expand Up @@ -255,10 +255,10 @@ def print_event(cpu, data, size):
if args.timestamp:
print("%-8s" % strftime("%H:%M:%S"), end=",")
print("%d" % g_time, end=",")
print(",".join(str(lens[c]) for c in xrange(ncpu)), end="")
print(",".join(str(lens[c]) for c in range(ncpu)), end="")
if args.fullcsv:
print(",", end="")
print(",".join(str(offs[c]) for c in xrange(ncpu)))
print(",".join(str(offs[c]) for c in range(ncpu)))
else:
print()
else:
Expand Down
4 changes: 2 additions & 2 deletions tools/tplist.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def print_tracepoints():
print_tpoint(category, event)

def print_usdt_argument_details(location):
for idx in xrange(0, location.num_arguments):
for idx in range(0, location.num_arguments):
arg = location.get_argument(idx)
print(" argument #%d %s" % (idx+1, arg))

def print_usdt_details(probe):
if args.verbosity > 0:
print(probe)
if args.verbosity > 1:
for idx in xrange(0, probe.num_locations):
for idx in range(0, probe.num_locations):
loc = probe.get_location(idx)
print(" location #%d %s" % (idx+1, loc))
print_usdt_argument_details(loc)
Expand Down

0 comments on commit d7a5ff0

Please sign in to comment.