| 135 | } |
| 136 | |
| 137 | void PostForkAction(bool IsChild) { |
| 138 | if (Enable) { |
| 139 | // Tracy does not support multiprocess profiling |
| 140 | LogMan::Msg::EFmt("Warning: Profiling a process with forks is not supported. Set the environment variable " |
| 141 | "FEX_PROFILE_WAIT_FOR_FORK=<n> to start profiling after the n-th fork."); |
| 142 | } |
| 143 | |
| 144 | if (IsChild) { |
| 145 | Enable = false; |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | if (EnableAfterFork > 1) { |
| 150 | --EnableAfterFork; |
| 151 | LogMan::Msg::IFmt("Tracy profiling will start after {} forks", EnableAfterFork); |
| 152 | } else if (EnableAfterFork == 1) { |
| 153 | Enable = true; |
| 154 | EnableAfterFork = 0; |
| 155 | tracy::StartupProfiler(); |
| 156 | LogMan::Msg::IFmt("Tracy profiling started"); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void Shutdown() { |
| 161 | if (Tracy::Enable) { |
no test coverage detected