bcc icon indicating copy to clipboard operation
bcc copied to clipboard

libbpf-tools: Add biotop tool.

Open eiffel-fl opened this issue 2 years ago • 4 comments

Hi.

I converted biotop from BCC to CO-RE. I tried to stick with the BCC behavior.

I just have two questions:

  1. 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
  2. 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.

eiffel-fl avatar Mar 03 '22 17:03 eiffel-fl

Hi.

I converted biotop from BCC to CO-RE. I tried to stick with the BCC behavior.

I just have two questions:

  1. 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.

  1. 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.

chenhengqi avatar Mar 05 '22 08:03 chenhengqi

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.

eiffel-fl avatar Mar 07 '22 10:03 eiffel-fl

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.

eiffel-fl avatar Mar 15 '22 12:03 eiffel-fl

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.

eiffel-fl avatar Mar 17 '22 13:03 eiffel-fl

Thank you for the merge!

eiffel-fl avatar Sep 19 '22 10:09 eiffel-fl