[PATCH 0/8] perf thread-stack: Fix thread stack processing for the idle task
From: Adrian Hunter
Date: Fri Dec 21 2018 - 07:08:08 EST
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