linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] perf thread-stack: Fix thread stack processing for the idle task
@ 2018-12-21 12:06 Adrian Hunter
  2018-12-21 12:06 ` [PATCH 1/8] perf thread-stack: Simplify some code in thread_stack__process() Adrian Hunter
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Adrian Hunter @ 2018-12-21 12:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Jiri Olsa, linux-kernel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-01-03 13:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 12:06 [PATCH 0/8] perf thread-stack: Fix thread stack processing for the idle task Adrian Hunter
2018-12-21 12:06 ` [PATCH 1/8] perf thread-stack: Simplify some code in thread_stack__process() Adrian Hunter
2019-01-03 13:22   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 2/8] perf thread-stack: Tidy thread_stack__bottom() usage Adrian Hunter
2019-01-03 13:23   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 3/8] perf thread-stack: Avoid direct reference to the thread's stack Adrian Hunter
2019-01-02 13:47   ` Arnaldo Carvalho de Melo
2019-01-03 13:23   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 4/8] perf thread-stack: Allow for a thread stack array Adrian Hunter
2019-01-03 13:24   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 5/8] perf thread-stack: Factor out thread_stack__init() Adrian Hunter
2019-01-03 13:24   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 6/8] perf thread-stack: Allocate an array of thread stacks Adrian Hunter
2019-01-01 18:28   ` Jiri Olsa
2019-01-02 13:43     ` Arnaldo Carvalho de Melo
2019-01-03 13:25   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-12-21 12:06 ` [PATCH 8/8] perf session: Add comment for perf_session__register_idle_thread() Adrian Hunter
2019-01-03 13:26   ` [tip:perf/urgent] " tip-bot for Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).