Granulate / gprofiler

gProfiler is a system-wide profiler, combining multiple sampling profilers to produce unified visualization of what your CPU is spending time on.
https://profiler.granulate.io
Apache License 2.0
746 stars 54 forks source link

java: Use glibc build of async-profiler for glibc-compat processes #737

Closed Jongy closed 1 year ago

Jongy commented 1 year ago

See related async-profiler ticket which explains further: https://github.com/async-profiler/async-profiler/pull/717

See the comment on needs_musl_ap_cached() for an explanation on this PR. I'm not adding an automatic test now because async-profiler currently fails running on the image I used to test it, anyway. The glibc build requires libstdc++ (unlike the musl build) but the image has musl and glibc-compat but NO libstdc++. At the very least, we don't crash glibc-compat processes anymore :shrug: which is what happens before this PR. That's a start...

I'm not sure I plan to support a glibc build with static libstdc++ (for this case) because async-profiler might, in the near future, be libc agnostic, and then we have to restructure the code here anyway. My goal with this PR now is to avoid crashing glibc-compat processes.

I tested it against the image ngrinder/controller:3.5.5 which runs a glibc-compat Java app.

Related granulate-utils PR: https://github.com/Granulate/granulate-utils/pull/134

Jongy commented 1 year ago

I re-triggered CI because I forgot to push the granulate-utils branch :dumb:

Jongy commented 1 year ago

Will merge once CI passes