Workaround for the kernel bug: PERF_EVENT_IOC_REFRESH can hang the entire system on Linux 6.16.x and 6.17.x. See https://github.com/async-profiler/async-profiler/issues/1578
| 175 | // the entire system on Linux 6.16.x and 6.17.x. |
| 176 | // See https://github.com/async-profiler/async-profiler/issues/1578 |
| 177 | static bool hasPerfEventRefreshBug() { |
| 178 | static struct utsname u{}; |
| 179 | if (u.release[0] == 0 && uname(&u) != 0) { |
| 180 | return false; |
| 181 | } |
| 182 | return strncmp(u.release, "6.16.", 5) == 0 || strncmp(u.release, "6.17.", 5) == 0; |
| 183 | } |
| 184 | |
| 185 | struct FunctionWithCounter { |
| 186 | const char* name; |