| 90 | } |
| 91 | |
| 92 | fn select_profiler(profiler_override: Option<WalltimeProfiler>) -> Option<Box<dyn Profiler>> { |
| 93 | match profiler_override { |
| 94 | Some(WalltimeProfiler::Perf) => Some(Box::new(PerfProfiler::new())), |
| 95 | Some(WalltimeProfiler::Samply) => Some(Box::new(SamplyProfiler::new())), |
| 96 | None => { |
| 97 | if cfg!(target_os = "linux") { |
| 98 | Some(Box::new(PerfProfiler::new())) |
| 99 | } else if cfg!(target_os = "macos") { |
| 100 | Some(Box::new(SamplyProfiler::new())) |
| 101 | } else { |
| 102 | None |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | impl WallTimeExecutor { |
| 109 | pub fn new(profiler_override: Option<WalltimeProfiler>) -> Self { |