Skip to content

perf thread-stack: Fix thread stack processing for the idle task

Adrian Hunter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. 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 filesSizeRepliesApplied
1/8perf thread-stack: Simplify some code in thread_stack__process()tools/perf/util/thread-stack.c+7 -110 replies
2/8perf thread-stack: Tidy thread_stack__bottom() usagetools/perf/util/thread-stack.c+3 -40 replies
3/8perf thread-stack: Avoid direct reference to the thread's stacktools/perf/util/thread-stack.c+49 -321 reply
4/8perf thread-stack: Allow for a thread stack arraytools/perf/util/thread-stack.c+34 -60 replies
5/8perf thread-stack: Factor out thread_stack__init()tools/perf/util/thread-stack.c+19 -70 replies
6/8perf thread-stack: Allocate an array of thread stackstools/perf/util/thread-stack.c+18 -122 replies
8/8perf session: Add comment for perf_session__register_idle_thread()tools/perf/util/session.c+7 -00 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchJiri Olsa
1/8
2/8
3/8
4/8
5/8
6/8A-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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