Commit 42da08aa authored by Javier Honduvilla Coto's avatar Javier Honduvilla Coto Committed by yonghong-song

Fix USDT probes arguments' encoding in Python3 (#1736)

* Fix USDT probes arguments' encoding in Python3

Running `trace` on a binary's USDT while fetching some arguments (
`sudo python3 trace.py -p $(pidof ruby) 'u:ruby:array__create "%d",
arg1'`) fails with `argument 2: <class 'TypeError'>: wrong type`.

This PR fixes the encoding of the USDT probe name in
udst.py `get_probe_arg_ctype` function. I've tested this works on Python 2 too.
parent 4139b198
...@@ -175,7 +175,7 @@ tplist tool.""") ...@@ -175,7 +175,7 @@ tplist tool.""")
def get_probe_arg_ctype(self, probe_name, arg_index): def get_probe_arg_ctype(self, probe_name, arg_index):
return lib.bcc_usdt_get_probe_argctype( return lib.bcc_usdt_get_probe_argctype(
self.context, probe_name, arg_index) self.context, probe_name.encode('ascii'), arg_index).decode()
def enumerate_probes(self): def enumerate_probes(self):
probes = [] probes = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment