1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 ///! Profiler API for thread registration and unregistration.
6 use crate::gecko_bindings::bindings;
9 /// Register a thread with the Gecko Profiler.
10 pub fn register_thread(thread_name: &str) {
11 let name = CString::new(thread_name).unwrap();
13 // gecko_profiler_register_thread copies the passed name here.
14 bindings::gecko_profiler_register_thread(name.as_ptr());
18 /// Unregister a thread with the Gecko Profiler.
19 pub fn unregister_thread() {
21 bindings::gecko_profiler_unregister_thread();