Plumb time profiler output into tracing (#34238)

* Plumb time profiler output into tracing

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Enter the span tightly around the callback

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Use `info_span!()` shorthand

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
Delan Azabani 2024-11-15 17:10:01 +08:00 committed by GitHub
parent 495cceb7de
commit aa7116c75d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 279 additions and 82 deletions

View file

@ -7,8 +7,8 @@ use std::io::Error;
use ipc_channel::ipc;
use serde::{Deserialize, Serialize};
use crate::time;
use crate::time::{ProfilerCategory, ProfilerChan};
use crate::time_profile;
pub struct IpcReceiver<T>
where
@ -23,7 +23,7 @@ where
T: for<'de> Deserialize<'de> + Serialize,
{
pub fn recv(&self) -> Result<T, ipc::IpcError> {
time::profile(
time_profile!(
ProfilerCategory::IpcReceiver,
None,
self.time_profile_chan.clone(),
@ -61,7 +61,7 @@ pub struct IpcBytesReceiver {
impl IpcBytesReceiver {
pub fn recv(&self) -> Result<Vec<u8>, ipc::IpcError> {
time::profile(
time_profile!(
ProfilerCategory::IpcBytesReceiver,
None,
self.time_profile_chan.clone(),