Skip to content

Commit

Permalink
Merge pull request iovisor#951 from r4f4/fix-trace-py3
Browse files Browse the repository at this point in the history
trace: fix for python3
  • Loading branch information
drzaeus77 committed Feb 9, 2017
2 parents 9b1916f + aee5ecf commit 6a94f77
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 6a94f77

Please sign in to comment.