Skip to content

Commit

Permalink
Fix folding option
Browse files Browse the repository at this point in the history
Using the "folding" option produces an error.

/usr/share/bcc/tools/offwaketime -f 3 > out.stacks

Traceback (most recent call last):
  File "/usr/share/bcc/tools/offwaketime", line 305, in <module>
    print("%s %d" % (str.join(";", line), v.value))
TypeError: sequence item 0: expected str instance, bytes found

It seems that k.target and k.waker are always type = bytes.  This edit resolves this error.
Thank you for your time.
  • Loading branch information
linuxraptor committed Jan 19, 2018
1 parent f1bb6ea commit fabd9a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/offwaketime.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def signal_ignore(signal, frame):
if folded:
# print folded stack output
line = \
[k.target] + \
[k.target.decode()] + \
[b.sym(addr, k.tgid)
for addr in reversed(list(target_user_stack)[1:])] + \
(["-"] if args.delimited else [""]) + \
Expand All @@ -301,7 +301,7 @@ def signal_ignore(signal, frame):
(["-"] if args.delimited else [""]) + \
[b.sym(addr, k.tgid)
for addr in reversed(list(waker_user_stack))] + \
[k.waker]
[k.waker.decode()]
print("%s %d" % (";".join(line), v.value))

else:
Expand Down

0 comments on commit fabd9a1

Please sign in to comment.