bcc
bcc copied to clipboard
libbpf-tools: Add biotop tool.
Hi.
I converted biotop
from BCC to CO-RE.
I tried to stick with the BCC behavior.
I just have two questions:
- I only probed on some functions, is this OK? Because I think we cannot try to probe like it it is done here: https://github.com/iovisor/bcc/blob/ca8240205e175e94cef3c70c3b5c5accbe51512f/tools/biotop.py#L178
- I am not really satisfied with the way I handle disk name. Sadly it is a bit complicated to use a hash map in C. So if someone sees a way to improve this, feel free to share :D.
Best regards.
Hi.
I converted
biotop
from BCC to CO-RE. I tried to stick with the BCC behavior.I just have two questions:
- I only probed on some functions, is this OK? Because I think we cannot try to probe like it it is done here: https://github.com/iovisor/bcc/blob/ca8240205e175e94cef3c70c3b5c5accbe51512f/tools/biotop.py#L178
Why not ? You just need to check which symbol exists and do bpf_program__set_attach_target.
- I am not really satisfied with the way I handle disk name. Sadly it is a bit complicated to use a hash map in C. So if someone sees a way to improve this, feel free to share :D.
This reminds me some discussions about introduce Rust-based libbpf-tools to BCC. @yonghong-song WDYT ?
Best regards.
Hi.
Thank you for your reviews:
Why not ? You just need to check which symbol exists and do bpf_program__set_attach_target.
I was not aware of this function, I will then add then add all the functions and probe some of them only if symbol exists.
This reminds me some discussions about introduce Rust-based libbpf-tools to BCC. @yonghong-song WDYT ?
I am not familiar to Rust, thus converting the C code to Rust would take me a bit of time. But I would be happy to learn it for this contribution!
Best regards.
I will not address this comments. I would like to first try to write a Rust control plane because it would solve all the problem we are having with the C one. I do not know when I will be able to do so. I will update this PR with some news when I have worked on it.
I am still not happy with the proposed solution but I addressed the above comments. I think, if bcc maintainers are OK with this, we can merge this version with a C control plane and I will come back later (in another PR) with a Rust one.
Thank you for the merge!