Hi, I am running into a perf stat issue with the -p option which allows you to attach to a running process. If that process happens to terminate while under monitoring perf hangs in there and never terminates. The proper behavior would be to stop. I can see the issue in that the attached process is not a child, so wait() would not work.
To reproduce: $ sleep 10 & $ perf stat -p $! doing the same with perf record works, so there is a solution to this problem.

