parca-agent icon indicating copy to clipboard operation
parca-agent copied to clipboard

Eliminate CGo usage from cgroup package

Open kakkoyun opened this issue 2 years ago • 3 comments

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

kakkoyun avatar Jan 19 '23 17:01 kakkoyun

The ID extraction mechanism has issues (current and upcoming). I'm double-checking it.

kakkoyun avatar Jan 24 '23 17:01 kakkoyun

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?

javierhonduco avatar Jan 25 '23 09:01 javierhonduco

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.

kakkoyun avatar Jan 25 '23 17:01 kakkoyun

Outdated since #2958

brancz avatar Aug 08 '24 08:08 brancz