perf
perf copied to clipboard
Bugfix: runtime.LockOSThread required for command
The ptrace API requires that you call it from the same thread, so starting the process must lock the thread until we're done with the ptrace API.
Doc ref: https://pkg.go.dev/syscall#SysProcAttr
Without this, if I use this in a tight loop, it hangs.