(
mut store: StoreContextMut<Host>,
f: impl FnOnce(&mut GuestProfiler, StoreContext<Host>),
)
| 1063 | )?)); |
| 1064 | |
| 1065 | fn sample( |
| 1066 | mut store: StoreContextMut<Host>, |
| 1067 | f: impl FnOnce(&mut GuestProfiler, StoreContext<Host>), |
| 1068 | ) { |
| 1069 | let mut profiler = store.data_mut().guest_profiler.take().unwrap(); |
| 1070 | f( |
| 1071 | Arc::get_mut(&mut profiler).expect("profiling doesn't support threads yet"), |
| 1072 | store.as_context(), |
| 1073 | ); |
| 1074 | store.data_mut().guest_profiler = Some(profiler); |
| 1075 | } |
| 1076 | |
| 1077 | // Hostcall entry/exit, etc. |
| 1078 | store.call_hook(|store, kind| { |