Eliminate CGo usage from cgroup package
Signed-off-by: Kemal Akkoyun [email protected]
We should remove as many CGo dependencies as possible. Switching from Go to C code at runtime always comes with increased costs in terms of CPU usage, so that is another reason to avoid mixed code.
TODO
- [ ] Checkout: https://github.com/iovisor/bcc/blob/master/examples/cgroupid/cgroupid.c
The ID extraction mechanism has issues (current and upcoming). I'm double-checking it.
The other day I forgot to suggest this, should we add this new implementation while keeping the old one and then run both and compare for mismatches?
That way we can ensure that the new implementation behaves exactly as the current one. What do you think?
The other day I forgot to suggest this, should we add this new implementation while keeping the old one and then run both and compare for mismatches?
That way we can ensure that the new implementation behaves exactly as the current one. What do you think?
For sure. FWIW, the previous implementation also gives an empty string.
On the other hand, I'm also questioning the need for this. It's not used anywhere. And we don't add it as a metadata label.
Outdated since #2958