-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dtrace probes #6816
Comments
Visiting for triage. I think at this point, probes like this should be standard in new languages. They are becoming an important tool for application performance testing and diagnostic work. Nominating feature complete. |
Making rust build on illumos / solaris would make dtrace integration a lot easier to develop |
Accepted for milestone 4, well-covered |
P-low, not 1.0. |
Hi - I'm a SystemTap developer, and I've created a prototype of our flavor of SDT for Rust on Linux: This would be very similar in concept to dtrace USDT, but AIUI the implementations are quite different. Conceivably, dtrace platforms could implement the same macro with different guts though, which is why I decided to share mine here. The macro inserts just a single NOP in the code, then ELF notes describe the probe and its arguments. SystemTap knows how to parse these, of course, and I gave a tiny example in the gist. GDB 7.5 gained support for SDT too, with I'm very new to rust, but the Thanks, and any feedback is welcome! |
Wow, that's awesome! Very nice work @cuviper! |
Thanks @alexcrichton! Do you think this could go in the standard library? If so, where should I put it, right in libstd/macros.rs? (With target_os guards and an empty implementation for non-linux, of course.) |
If you want to upstream it for now, these macros should probably reside in a separate library I think that unfortunately any crate using the |
Does it make sense to be a separate library even if core parts will be using it? That's the only reason I thought it should be in libstd. I'm also not sure how a macro-only library would function. Ideally, you'd want it to be present just for compilation, but there's nothing that needs to be linked at runtime. (But perhaps other platforms might need runtime stuff.) For the |
As a macro-only library, it could likely get built before libstd (so libstd could depend on it if necessary), as it wouldn't have any runtime dependencies. We currently support macro-only libraries through: #[phase(syntax)] // don't link to this crate, just get some macros
extern crate probe;
fn main() {
probe!(...)
} |
Great, thanks, I'll play with it and send a PR. |
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized. This issue has been moved to the RFCs repo: rust-lang/rfcs#875 |
Using `f32::EPSILON` or `f64::EPSILON` as the floating-point equality comparison error margin is incorrect, yet `float_cmp` has until now recommended this be done. This change fixes the given guidance (both in docs and compiler hints) to not reference these unsuitable constants. Instead, the guidance now clarifies that the scenarios in which an absolute error margin is usable, provides a reference implementation of using a user-defined absolute error margin (as an absolute error margin can only be used-defined and may be different for different comparisons) and references the floating point guide for a reference implementation of relative error based equaltiy comparison for when absolute error margin cannot be used. changelog: Fix guidance of [`float_cmp`] and [`float_cmp_const`] to not incorrectly recommend `f64::EPSILON` as the error margin. Fixes rust-lang#6816
…idance, r=y21 Fix guidance of [`float_cmp`] and [`float_cmp_const`] to not incorrectly recommend `f__::EPSILON` as the error margin. Using `f32::EPSILON` or `f64::EPSILON` as the floating-point equality comparison error margin is incorrect, yet `float_cmp` has until now recommended this be done. This change fixes the given guidance (both in docs and compiler hints) to not reference these unsuitable constants. Instead, the guidance now clarifies that the scenarios in which an absolute error margin is usable, provides a sample implementation for using a user-defined absolute error margin (as an absolute error margin can only be used-defined and may be different for different comparisons) and references the floating point guide for a reference implementation of relative error based equality comparison for cases where absolute error margins cannot be identified. changelog: [`float_cmp`] Fix guidance to not incorrectly recommend `f__::EPSILON` as the error margin. changelog: [`float_cmp_const`] Fix guidance to not incorrectly recommend `f__::EPSILON` as the error margin. Fixes rust-lang#6816
I think rust should expose dtrace userland probes
Links:
http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_USDT
https://wikis.oracle.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications
https://wiki.freebsd.org/DTrace/userland
Some specific providers (including some dynamic):
https://github.com/chrisa/libusdt
https://github.com/chrisa/node-dtrace-provider
http://prefetch.net/projects/apache_modtrace/index.html
https://bugzilla.mozilla.org/show_bug.cgi?id=370906
Probably at least some for pervasive / standard-library actions:
Note that the "USDT" mechanism provides static probes whereas things like
libusdt
(above) provide an API for dynamically registering probes at runtime. This is probably important, possibly even a good place to start, though it's slightly more expensive; ideally of course we should be able to provide both.See also #6810 concerning
metrics
. I think there's some potential design-informing between the two. Possibly libusdt as a reporting sink for metrics?The text was updated successfully, but these errors were encountered: