pub fn with_profiling<F, R>(f: F) -> Result<R>where F: FnOnce() -> R,
Run f with profiling enabled; always stops on return (even on panic unwind via the guard’s drop).
f