Description of problem: commit 448ce0e enbales ignore_missing_thread on perf stat, but perf may still return sys_perf_event_open failure with 3(No such process) when stating multiple events since commit 448ce0e only set ignore_missing_thread flag on the first evsel, and when thread dies between opening following events, perf will fail with 3. link to commit 448ce0e: https://github.com/torvalds/linux/commit/448ce0e6ea93ae99e0b36055e5f5a3f723fe3665#diff-aa5d9c1b58d3c6129afb0d4cb977d806a218039836bd565102f26e2be3e11859 Version-Release number of selected component (if applicable): How reproducible: use perf to stat multiple (e.g. more than 100) events on a multi-threaded (e.g. more than 100 threads) process which frequently create and end threads, Steps to Reproduce: 1. use perf to stat multiple (e.g. more than 100) events on a multi-threaded (e.g. more than 100 threads) process which frequently create and end threads 2. and you may see perf return sys_perf_event_open failure with 3(No such process) 3. you can use strace perf stat [args] may make the bug easier to reproduce as perf runs much slower with strace attaching on it Actual results: perf return sys_perf_event_open failure with 3(No such process) Expected results: perf continue monitoring the remaining threads and do not exit with error. Additional info:
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5067
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5070
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5071
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5072