[PROF-4779] Refactor in preparation for use of libddprof from profiling native extension#1885
Conversation
lloeki
left a comment
There was a problem hiding this comment.
LGTM, probably worth another pair of eyes as to how this behaves overall WRT general ddtrace user usage.
b68274a to
1090d71
Compare
|
This PR was opened to target the 1.0 branch. I've just rebased it now on top of current master, and moved it to target that branch, since 1.0 is no more. No further changes :) |
Codecov Report
@@ Coverage Diff @@
## master #1885 +/- ##
==========================================
- Coverage 97.51% 97.51% -0.01%
==========================================
Files 997 999 +2
Lines 48739 48858 +119
==========================================
+ Hits 47528 47642 +114
- Misses 1211 1216 +5
Continue to review full report at Codecov.
|
|
@delner care to chime in? |
8ae9ea1 to
da925a0
Compare
|
I've just did another rebase of this PR, fixing a conflict and adding a few cleanups for things that had since became a bit stale. Before this PR gets merged in we must release libddprof 0.6.0 on rubygems.org: DataDog/libddprof#59 since older versions will break some of our integration tests (see da925a0 for details). |
|
Converted to draft as we're still waiting on 1.1.0 to go out, and then possible a rebase and maybe pull in a fix or two :) |
Also reviewed some of the wording in the user-visible banners.
These validations mean that the profiler native extension will no longer be built unless libddprof is avaliable. The extension itself does not yet get compiled using libddprof.
Because we're not yet using any of the functions, libddprof will actually be thrown away at linking time, but everything is ready for us to use them.
…ment in docker volume This avoids a massive performance hit when this folder is shared with a macOS host (seconds to minutes, I kid you not!).
I was not liking how this was looking. This is much nicer!
… on unsupported platforms
…on is available Now that libddprof is in the picture, the profiling native extension will usually not be built for macOS, so we allow these tests to fail when no extension is available.
This is a much nicer approach than just adding them and hoping for the best! Also, it means we can enable more warnings, even if they get ignored on older compilers.
This is a temporary measure to simplify PR <#1885>. A later PR will re-enable all of this.
da925a0 to
be6fb26
Compare
|
I've rebased this PR, did a few cleanups, and disabled actually linking to libddprof so we can merge it in ASAP. |
| before do | ||
| skip 'Profiling is not supported on JRuby' if PlatformHelpers.jruby? | ||
| skip 'Profiling is not supported on TruffleRuby' if PlatformHelpers.truffleruby? | ||
| skip_if_profiling_not_supported(self) |
|
Thanks y'all! Let's get this show on the road :) |
libddprofis a Rust-based library that implements common functionality used by our profilers:This PR adds the scaffolding to enable usage of libddprof from dd-trace-rb, but does not yet make use of any of its functionality.
Currently, libddprof works for all supported Rubies (2.1 to 3.2 dev) but only on x86-64 and 64-bit ARM Linux. The current integration has been set up in such a way that on other platforms we print a nice banner telling customers that they won't have profiling but do not otherwise impact the customer in using all other Datadog products (tracing, ci, appsec, ...).
This PR includes a nice refactoring + addition of tests to make sure this safe installation behavior is working correctly.
Note: To allow this PR to be merged in more quickly, I've commented out the actual libddprof linking bits in
extconf.rb; I'll re-enable that in a later PR.