perf thread-stack: Fix thread stack processing for the idle task
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 of 8 patches 3 repliesIn review
7 of 8 patches are in this archive. The cover letter announces 8.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | perf thread-stack: Simplify some code in thread_stack__process()tools/ | +7 | 0 replies | |
| 2/8 | perf thread-stack: Tidy thread_stack__bottom() usagetools/ | +3 | 0 replies | |
| 3/8 | perf thread-stack: Avoid direct reference to the thread's stacktools/ | +49 | 1 reply | |
| 4/8 | perf thread-stack: Allow for a thread stack arraytools/ | +34 | 0 replies | |
| 5/8 | perf thread-stack: Factor out thread_stack__init()tools/ | +19 | 0 replies | |
| 6/8 | perf thread-stack: Allocate an array of thread stackstools/ | +18 | 2 replies | |
| 8/8 | perf session: Add comment for perf_session__register_idle_thread()tools/ | +7 | 0 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Jiri Olsa |
|---|---|
| 1/8 | |
| 2/8 | |
| 3/8 | |
| 4/8 | |
| 5/8 | |
| 6/8 | A-b |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/8] perf thread-stack: Fix thread stack processing for the idle task
Hi
Here are some patches that fix thread stack processing for the idle task. Patches 1-6 are preparation. The fix is patch 7. Patch 8 is a comment to explain the issue in perf_session__register_idle_thread().
perf creates a single 'struct thread' to represent the idle task. That is because threads are identified by pid and tid, and the idle task always has pid == tid == 0. However, there are actually separate idle tasks for each cpu. That creates a problem for thread stack processing which assumes that each thread has a single stack, not one stack per cpu. Fix that by passing through the cpu number, and in the case of the idle "thread", pick the thread stack from an array based on the cpu number.
Adrian Hunter (8):
perf thread-stack: Simplify some code in thread_stack__process() perf thread-stack: Tidy thread_stack__bottom() usage perf thread-stack: Avoid direct reference to the thread's stack perf thread-stack: Allow for a thread stack array
perf thread-stack: Factor out thread_stack__init() perf thread-stack: Allocate an array of thread stacks perf thread-stack: Fix thread stack processing for the idle task perf session: Add comment for perf_session__register_idle_thread()
tools/perf/builtin-script.c | 4 +- tools/perf/util/intel-bts.c | 4 +- tools/perf/util/intel-pt.c | 6 +- tools/perf/util/session.c | 7 ++ tools/perf/util/thread-stack.c | 228 +++++++++++++++++++++++++++++------------ tools/perf/util/thread-stack.h | 8 +- 6 files changed, 183 insertions(+), 74 deletions(-)
Regards
Adrian