pw_utils: Add Tracy spans to ShmMapping
Browse files at this commitd5bc484df172c5aaf34e38a79b218ac41977c009Parent: 6b02f421 changed file +4 -0
src/screencasting/pw_utils/shm_mapping.rsmodified+4 -0
| @@ -37,6 +37,8 @@ impl ShmMapping { | ||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | pub(super) fn copy_frame(&self, bytes: &[u8]) { |
| 40 | + let _span = tracy_client::span!(); | |
| 41 | + | |
| 40 | 42 | // SAFETY: The constructor's contract keeps the memory valid and ensures |
| 41 | 43 | // exclusive access during this write. No references into the mapping escape. |
| 42 | 44 | let buffer = unsafe { slice::from_raw_parts_mut(self.address.cast::<u8>(), self.len) }; |
| @@ -44,6 +46,8 @@ impl ShmMapping { | ||
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | pub(super) fn clear(&self) { |
| 49 | + let _span = tracy_client::span!(); | |
| 50 | + | |
| 47 | 51 | // SAFETY: As in copy_frame, the mapping is valid and exclusively accessed. |
| 48 | 52 | let buffer = unsafe { slice::from_raw_parts_mut(self.address.cast::<u8>(), self.len) }; |
| 49 | 53 | buffer.fill(0); |