From: Rafael Fonseca Date: Fri, 10 Feb 2017 12:50:13 +0000 (+0100) Subject: usdt: convert text from bytes to str X-Git-Tag: v0.3.0~48^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d981513c6347e939db8a05722d02ea3b90dec9f;p=platform%2Fupstream%2Fbcc.git usdt: convert text from bytes to str This fixes a TypeError in python 3, e.g, when executing uobjnew Traceback (most recent call last): File "./uobjnew", line 134, in bpf = BPF(text=program, usdt_contexts=[usdt]) File "/usr/lib/python3.5/site-packages/bcc/__init__.py", line 224, in __init__ text = usdt_text + text TypeError: can't concat bytes to str --- diff --git a/src/python/bcc/usdt.py b/src/python/bcc/usdt.py index 19a3a98..a5278f3 100644 --- a/src/python/bcc/usdt.py +++ b/src/python/bcc/usdt.py @@ -128,7 +128,7 @@ class USDT(object): probe) def get_text(self): - return lib.bcc_usdt_genargs(self.context) + return lib.bcc_usdt_genargs(self.context).decode() def get_probe_arg_ctype(self, probe_name, arg_index): return lib.bcc_usdt_get_probe_argctype(