Skip to content

RFC powerpc: ftrace updates

Naveen N Rao linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9powerpc/ftrace: Fix indentation in ftrace.harch/powerpc/include/asm/ftrace.h+1 -10 replies
2/9powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry codearch/powerpc/kernel/trace/ftrace.c arch/powerpc/kernel/trace/ftrace_entry.S+6 -40 replies
3/9powerpc/ftrace: Remove nops after the call to ftrace_stubarch/powerpc/kernel/trace/ftrace_entry.S+0 -20 replies
4/9powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4Barch/powerpc/Kconfig arch/powerpc/include/asm/linkage.h+1 -30 replies
5/9powerpc/kprobes: Use ftrace to determine if a probe is at function entryarch/powerpc/kernel/kprobes.c+8 -101 reply
6/9powerpc/ftrace: Update and move function profile instructions out-of-linearch/powerpc/Makefile arch/powerpc/include/asm/code-patching.h arch/powerpc/include/asm/ftrace.h +3 more+246 -474 replies
7/9powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPSarch/powerpc/Kconfig arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/trace/ftrace.c +1 more+91 -120 replies
8/9powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLSarch/powerpc/Kconfig arch/powerpc/include/asm/ftrace.h arch/powerpc/kernel/asm-offsets.c +1 more+93 -250 replies
9/9samples/ftrace: Add support for ftrace direct samples on powerpcarch/powerpc/Kconfig samples/ftrace/ftrace-direct-modify.c samples/ftrace/ftrace-direct-multi-modify.c +3 more+398 -50 replies

Reviews trailers per patch

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

PatchMasami Hiramatsu (Google)
1/9
2/9
3/9
4/9
5/9A-b
6/9
7/9
8/9
9/9

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

Read the v1 thread

Cover letter [RFC PATCH 0/9] powerpc: ftrace updates

Early RFC.

This series attempts to address couple of issues with the existing support for ftrace on powerpc, with a view towards improving performance when ftrace is not enabled. See patch 6 for more details.

Patches 7 and 8 implement support for ftrace direct calls, through adding support for DYNAMIC_FTRACE_WITH_CALL_OPS.

The first 5 patches are minor cleanups and updates, and can go in separately.

This series depends on Benjamin Gray's series adding support for patch_ulong().

I have lightly tested this patch set and it looks to be working well. As described in patch 6, context_switch microbenchmark shows an improvement of ~6% with this series with ftrace disabled. Performance when ftrace is enabled reduces due to how DYNAMIC_FTRACE_WITH_CALL_OPS works, and due to support for direct calls. Some of that can hopefully be improved, if this approach is otherwise ok.

- Naveen

Naveen N Rao (8):
powerpc/ftrace: Fix indentation in ftrace.h powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code powerpc/ftrace: Remove nops after the call to ftrace_stub powerpc/kprobes: Use ftrace to determine if a probe is at function
entry
powerpc/ftrace: Update and move function profile instructions
out-of-line
powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS samples/ftrace: Add support for ftrace direct samples on powerpc

Sathvika Vasireddy (1):
powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B

 arch/powerpc/Kconfig                        |   6 +
 arch/powerpc/Makefile                       |   6 +-
 arch/powerpc/include/asm/code-patching.h    |  15 +-
 arch/powerpc/include/asm/ftrace.h           |  35 ++-
 arch/powerpc/include/asm/linkage.h          |   3 -
 arch/powerpc/kernel/asm-offsets.c           |   7 +
 arch/powerpc/kernel/kprobes.c               |  69 +++++-
 arch/powerpc/kernel/trace/ftrace.c          | 231 ++++++++++++++++----
 arch/powerpc/kernel/trace/ftrace_entry.S    | 182 +++++++++++----
 samples/ftrace/ftrace-direct-modify.c       |  94 +++++++-
 samples/ftrace/ftrace-direct-multi-modify.c | 110 +++++++++-
 samples/ftrace/ftrace-direct-multi.c        |  64 +++++-
 samples/ftrace/ftrace-direct-too.c          |  72 +++++-
 samples/ftrace/ftrace-direct.c              |  61 +++++-
 14 files changed, 845 insertions(+), 110 deletions(-)

base-commit: 9a15ae60f2c9707433b01e55815cd9142be102b2
prerequisite-patch-id: 38d3e705bf2e27cfa5e3ba369a6ded84ba6615c2
prerequisite-patch-id: 609d292e054b2396b603890522a940fa0bdfb6d8
prerequisite-patch-id: 6f7213fb77b1260defbf43be0e47bff9c80054cc
prerequisite-patch-id: f2328625ae2193c3c8e336b154b62030940cece8

Signature · 1 line
2.43.0