Bug 19874 - perf stat: ignore missing thread fails when stating multiple events
Summary: perf stat: ignore missing thread fails when stating multiple events
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: debugability (show other bugs) debugability
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: xiangzao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-31 15:45 UTC by lilinhang
Modified: 2025-04-15 14:41 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lilinhang 2025-03-31 15:45:21 UTC
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:
Comment 1 小龙 admin 2025-04-15 14:35:58 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5067
Comment 2 小龙 admin 2025-04-15 14:37:46 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5070
Comment 3 小龙 admin 2025-04-15 14:39:30 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5071
Comment 4 小龙 admin 2025-04-15 14:41:11 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5072