Skip to content

RFC powerpc: Stack tracer fixes

Naveen N. Rao linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6trace/stack: Move code to save the stack trace into a separate functioninclude/linux/ftrace.h kernel/trace/trace_stack.c+60 -463 replies
2/6powerpc/trace: Add support for stack tracerarch/powerpc/include/asm/ftrace.h arch/powerpc/kernel/trace/ftrace.c+88 -01 reply
3/6powerpc: Indicate traced function name in show_stack()arch/powerpc/kernel/process.c+3 -00 replies
4/6powerpc/perf: Include traced function in the callchainarch/powerpc/perf/callchain.c+5 -00 replies
5/6powerpc/stacktrace: Include ftraced function in arch_stack_walk_reliable()arch/powerpc/kernel/stacktrace.c+4 -00 replies
6/6powerpc/stacktrace: Include ftraced function in arch_stack_walk()arch/powerpc/kernel/stacktrace.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/6] powerpc: Stack tracer fixes

While the stack tracer worked fine with ppc64 ELFv1 ABI, it was never ported/enabled to run properly with ppc64 ELFv2 ABI, -mprofile-kernel in particular. The primary issue is that the call to ftrace happens before a function sets up its own stackframe. Due to this, the traced function never shows up in the stack trace. This produces confusing results, especially with the stack trace filter and is evident with the selftest failure. This is also an issue on ppc32.

The first two commits add support to the stack tracer for powerpc. This support utilizes the powerpc ABI to produce reliable stack traces, as well as to determine stackframe sizes.

Patches 3, 4 and 6 add support for decoding the traced function name in various stack traces and to show the same.

Patch 5 makes this change for livepatching and I am a bit unsure of this change. More details in patch 5.

- Naveen

Naveen N. Rao (6):
trace/stack: Move code to save the stack trace into a separate
function
powerpc/trace: Add support for stack tracer
powerpc: Indicate traced function name in show_stack() powerpc/perf: Include traced function in the callchain powerpc/stacktrace: Include ftraced function in
arch_stack_walk_reliable()
powerpc/stacktrace: Include ftraced function in arch_stack_walk()

 arch/powerpc/include/asm/ftrace.h  | 18 ++++++
 arch/powerpc/kernel/process.c      |  3 +
 arch/powerpc/kernel/stacktrace.c   |  8 +++
 arch/powerpc/kernel/trace/ftrace.c | 70 +++++++++++++++++++++
 arch/powerpc/perf/callchain.c      |  5 ++
 include/linux/ftrace.h             |  8 +++
 kernel/trace/trace_stack.c         | 98 ++++++++++++++++--------------
 7 files changed, 164 insertions(+), 46 deletions(-)

base-commit: 258eb1f3aaa9face35e613c229c1337263491ea0

Signature · 1 line
2.30.2