usdt: fix argument passing on python3 (#984)
authorRafael F <r4f4rfs@gmail.com>
Fri, 3 Mar 2017 18:56:50 +0000 (19:56 +0100)
committerSasha Goldshtein <goldshtn@gmail.com>
Fri, 3 Mar 2017 18:56:50 +0000 (20:56 +0200)
This fixes the following error:

$: ./tplist -v -v -l /usr/lib64/dri/i965_dri.so
argument 1: <class 'TypeError'>: wrong type

src/python/bcc/usdt.py

index e65f379..4f50413 100644 (file)
@@ -130,7 +130,7 @@ class USDT(object):
                 raise USDTException("USDT failed to instrument PID %d" % pid)
         elif path:
             self.path = path
-            self.context = lib.bcc_usdt_new_frompath(path)
+            self.context = lib.bcc_usdt_new_frompath(path.encode('ascii'))
             if self.context == None:
                 raise USDTException("USDT failed to instrument path %s" % path)
         else: