Closed bernhardkaindl closed 4 months ago
tools/argdist.py: Fix verbose printing b'bytes': decode bytes to str
tools/argdist.py
b'bytes'
bytes
str
The uprobe and kprobe keys are bytes not str they need to be decoded on Python3:
uprobe
kprobe
print("open uprobes: %s" % list(self.bpf.uprobe_fds.keys())) print("open kprobes: %s" % list(self.bpf.kprobe_fds.keys()))
This fixes the --verbose output from b['key1', b'key2'] to key1, key2, as the keys would be printed in Python2 originally:
--verbose
b['key1', b'key2']
key1, key2
- print("open uprobes: %s" % list(self.bpf.uprobe_fds.keys())) - print("open kprobes: %s" % list(self.bpf.kprobe_fds.keys())) + print("open uprobes: [%s]" % b", ".join(self.bpf.uprobe_fds.keys()).decode()) + print("open kprobes: [%s]" % b", ".join(self.bpf.kprobe_fds.keys()).decode()) ```
tools/argdist.py
: Fix verbose printingb'bytes'
: decodebytes
tostr
The
uprobe
andkprobe
keys arebytes
notstr
they need to be decoded on Python3:This fixes the
--verbose
output fromb['key1', b'key2']
tokey1, key2
, as the keys would be printed in Python2 originally: