summaryrefslogtreecommitdiffstats
path: root/third_party/rust/profiling/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/profiling/src/lib.rs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/profiling/src/lib.rs')
-rw-r--r--third_party/rust/profiling/src/lib.rs78
1 files changed, 78 insertions, 0 deletions
diff --git a/third_party/rust/profiling/src/lib.rs b/third_party/rust/profiling/src/lib.rs
new file mode 100644
index 0000000000..75703408d8
--- /dev/null
+++ b/third_party/rust/profiling/src/lib.rs
@@ -0,0 +1,78 @@
+//
+// To use this library, enable one of the feature flags. Each backend implementation provides the
+// exact same interface. Only one may be active at a time.
+//
+
+/// Proc macro for creating a scope around the function, using the name of the function for the
+/// scope's name
+///
+/// This must be done as a proc macro because tracing requires a const string
+///
+/// ```
+/// #[profiling::function]
+/// fn my_function() {
+///
+/// }
+/// ```
+#[cfg(feature = "procmacros")]
+pub use profiling_procmacros::function;
+
+#[cfg(feature = "profile-with-puffin")]
+pub use puffin;
+#[cfg(feature = "profile-with-puffin")]
+mod puffin_impl;
+#[cfg(feature = "profile-with-puffin")]
+pub use puffin_impl::*;
+
+#[cfg(feature = "profile-with-optick")]
+pub use optick;
+#[cfg(feature = "profile-with-optick")]
+mod optick_impl;
+#[cfg(feature = "profile-with-optick")]
+pub use optick_impl::*;
+
+#[cfg(feature = "profile-with-superluminal")]
+pub use superluminal_perf;
+#[cfg(feature = "profile-with-superluminal")]
+mod superluminal_impl;
+#[cfg(feature = "profile-with-superluminal")]
+pub use superluminal_impl::*;
+
+#[cfg(feature = "profile-with-tracing")]
+pub use tracing;
+#[cfg(feature = "profile-with-tracing")]
+mod tracing_impl;
+#[cfg(feature = "profile-with-tracing")]
+pub use tracing_impl::*;
+
+#[cfg(feature = "profile-with-tracy")]
+pub use tracy_client;
+#[cfg(feature = "profile-with-tracy")]
+mod tracy_impl;
+#[cfg(feature = "profile-with-tracy")]
+pub use tracy_impl::*;
+
+#[cfg(feature = "type-check")]
+mod type_check_impl;
+#[cfg(feature = "type-check")]
+pub use type_check_impl::*;
+
+#[cfg(not(any(
+ feature = "profile-with-puffin",
+ feature = "profile-with-optick",
+ feature = "profile-with-superluminal",
+ feature = "profile-with-tracing",
+ feature = "profile-with-tracy",
+ feature = "type-check"
+)))]
+mod empty_impl;
+
+#[cfg(not(any(
+ feature = "profile-with-puffin",
+ feature = "profile-with-optick",
+ feature = "profile-with-superluminal",
+ feature = "profile-with-tracing",
+ feature = "profile-with-tracy",
+ feature = "type-check"
+)))]
+pub use empty_impl::*;