Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argdist.py: Fix verbose printing b'bytes': decode bytes to str #5005

Conversation

bernhardkaindl
Copy link
Contributor

tools/argdist.py: Fix verbose printing b'bytes': decode bytes to str

The uprobe and kprobe keys are bytes not str they need to be decoded on Python3:

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:

- 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())                                                            ```  

Signed-off-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
@yonghong-song yonghong-song merged commit c93a19a into iovisor:master May 19, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants