Add support for profiling using tracy
This commit is contained in:
parent
929f4fcb05
commit
a1c8b3aa3e
18 changed files with 122 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -38,6 +38,11 @@ pub mod utils;
|
|||
pub mod wayland;
|
||||
pub mod xwayland;
|
||||
|
||||
#[cfg(feature = "profile-with-tracy")]
|
||||
#[global_allocator]
|
||||
static GLOBAL: profiling::tracy_client::ProfiledAllocator<std::alloc::System> =
|
||||
profiling::tracy_client::ProfiledAllocator::new(std::alloc::System, 10);
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// setup logger
|
||||
logger::init_logger()?;
|
||||
|
|
@ -80,6 +85,11 @@ fn main() -> Result<()> {
|
|||
warn!(?err, "Failed to watch theme");
|
||||
}
|
||||
|
||||
#[cfg(feature = "profile-with-tracy")]
|
||||
profiling::tracy_client::Client::start();
|
||||
|
||||
profiling::register_thread!("Main Thread");
|
||||
|
||||
// run the event loop
|
||||
event_loop.run(None, &mut state, |state| {
|
||||
// shall we shut down?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue