summaryrefslogtreecommitdiffstats
path: root/third_party/rust/profiling/src/empty_impl.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/rust/profiling/src/empty_impl.rs
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/profiling/src/empty_impl.rs')
-rw-r--r--third_party/rust/profiling/src/empty_impl.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/third_party/rust/profiling/src/empty_impl.rs b/third_party/rust/profiling/src/empty_impl.rs
new file mode 100644
index 0000000000..ac106a10bb
--- /dev/null
+++ b/third_party/rust/profiling/src/empty_impl.rs
@@ -0,0 +1,34 @@
+/// Opens a scope. Two variants:
+/// - profiling::scope!(name: &str) - Opens a scope with the given name
+/// - profiling::scope!(name: &str, data: &str) - Opens a scope with the given name and an extra
+/// datafield. Details of this depend on the API, but it should be a &str. If the extra data is
+/// named, it will be named "tag". Some APIs support adding more data (for example, `optic::tag!`)
+///
+/// ```
+/// profiling::scope!("outer");
+/// for _ in 0..10 {
+/// profiling::scope!("inner", format!("iteration {}").as_str());
+/// }
+/// ```
+#[macro_export]
+macro_rules! scope {
+ ($name:expr) => {};
+ ($name:expr, $data:expr) => {};
+}
+
+/// Registers a thread with the profiler API(s). This is usually setting a name for the thread.
+/// Two variants:
+/// - register_thread!() - Tries to get the name of the thread, or an ID if no name is set
+/// - register_thread!(name: &str) - Registers the thread using the given name
+#[macro_export]
+macro_rules! register_thread {
+ () => {};
+ ($name:expr) => {};
+}
+
+/// Finishes the frame. This isn't strictly necessary for some kinds of applications but a pretty
+/// normal thing to track in games.
+#[macro_export]
+macro_rules! finish_frame {
+ () => {};
+}