From eba1483f2caabb21047399582bfe3600d5b75017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= Date: Mon, 25 Jun 2018 18:35:46 +0200 Subject: [PATCH] Decode C strings into Python strings (#1847) Leftover from #986. --- tools/profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/profile.py b/tools/profile.py index ec5533f51c3c..dd57e1b28874 100755 --- a/tools/profile.py +++ b/tools/profile.py @@ -304,7 +304,7 @@ def aksym(addr): # print folded stack output user_stack = list(user_stack) kernel_stack = list(kernel_stack) - line = [k.name.decode()] + line = [k.name] # if we failed to get the stack is, such as due to no space (-ENOMEM) or # hash collision (-EEXIST), we still print a placeholder for consistency if not args.kernel_stacks_only: @@ -318,7 +318,7 @@ def aksym(addr): line.append("[Missed Kernel Stack]") else: line.extend([b.ksym(addr) for addr in reversed(kernel_stack)]) - print("%s %d" % (";".join(line), v.value)) + print("%s %d" % (b";".join(line).decode(), v.value)) else: # print default multi-line stack output if not args.user_stacks_only: @@ -334,7 +334,7 @@ def aksym(addr): print(" [Missed User Stack]") else: for addr in user_stack: - print(" %s" % b.sym(addr, k.pid)) + print(" %s" % b.sym(addr, k.pid).decode()) print(" %-16s %s (%d)" % ("-", k.name.decode(), k.pid)) print(" %d\n" % v.value)