Skip to content

Commit

Permalink
trace: fix for python3
Browse files Browse the repository at this point in the history
xrange does not exist in py3.
  • Loading branch information
r4f4 committed Feb 8, 2017
1 parent 3e77af5 commit aee5ecf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ def print_stack(self, bpf, stack_id, tgid):

def _format_message(self, bpf, tgid, values):
# Replace each %K with kernel sym and %U with user sym in tgid
kernel_placeholders = [i for i in xrange(0, len(self.types))
if self.types[i] == 'K']
user_placeholders = [i for i in xrange(0, len(self.types))
if self.types[i] == 'U']
kernel_placeholders = [i for i, t in enumerate(self.types)
if t == 'K']
user_placeholders = [i for i, t in enumerate(self.types)
if t == 'U']
for kp in kernel_placeholders:
values[kp] = bpf.ksymaddr(values[kp])
for up in user_placeholders:
Expand Down

0 comments on commit aee5ecf

Please sign in to comment.