]> Gentwo Git Trees - linux/.git/commit
s390/ptrace: Always inline regs_get_kernel_stack_nth() and regs_get_register()
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 9 May 2025 13:42:48 +0000 (15:42 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Sat, 17 May 2025 08:55:00 +0000 (10:55 +0200)
commitd35ef47a43f8a01252e89b1fd4a52c91017b5d59
tree4750787893f1e530176f0cc04657f4e89b65d7c1
parent5c4a8632e86aa68514eef9480b0b838d1aa3f24a
s390/ptrace: Always inline regs_get_kernel_stack_nth() and regs_get_register()

Both regs_get_kernel_stack_nth() and regs_get_register() are not
inlined. With the new ftrace funcgraph-args feature they show up in
function graph tracing:

  4)               |          sched_core_idle_cpu(cpu=4) {
  4)   0.257 us    |            regs_get_register(regs=0x37fe00afa10, offset=2);
  4)   0.218 us    |            regs_get_register(regs=0x37fe00afa10, offset=3);
  4)   0.225 us    |            regs_get_register(regs=0x37fe00afa10, offset=4);
  4)   0.239 us    |            regs_get_register(regs=0x37fe00afa10, offset=5);
  4)   0.239 us    |            regs_get_register(regs=0x37fe00afa10, offset=6);
  4)   0.245 us    |            regs_get_kernel_stack_nth(regs=0x37fe00afa10, n=20);

This is subtoptimal, since both functions are supposed to be ftrace
internal helper functions. If they appear in ftrace traces this reduces
readability significantly, plus this adds tons of extra useless extra
entries.

Address this by moving both functions and required helpers to ptrace.h and
always inline them. This way they don't appear in traces anymore. In
addition the overhead that comes with functions calls is also reduced.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/ptrace.h
arch/s390/kernel/ptrace.c