Skip to content

Commit 343c332

Browse files
RashmicaGmpe
authored andcommitted
powerpc: Add rN aliases to the pt_regs_offset table.
It is common practice with powerpc to use 'rN' to refer to register 'N'. However when using the pt_regs_offset table we have to use 'gprN'. So add aliases such that both 'rN' and 'gprN' can be used. For example, we can currently do: $ su - $ cd /sys/kernel/debug/tracing $ echo "p:probe/sys_fchownat sys_fchownat %gpr3:s32 +0(%gpr4):string %gpr5:s32 %gpr6:s32 %gpr7:s32" > kprobe_events $ echo 1 > events/probe/sys_fchownat/enable $ touch /tmp/foo $ chown root /tmp/foo $ echo 0 > events/enable $ cat trace chown-2925 [014] d... 76.160657: sys_fchownat: (SyS_fchownat+0x8/0x1a0) arg1=-100 arg2="/tmp/foo" arg3=0 arg4=-1 arg5=0 Instead we'd like to be able to use: $ echo "p:probe/sys_fchownat sys_fchownat %r3:s32 +0(%r4):string %r5:s32 %r6:s32 %r7:s32" > kprobe_events Signed-off-by: Rashmica Gupta <rashmicy@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent f43194e commit 343c332

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/powerpc/kernel/ptrace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct pt_regs_offset {
6060
#define STR(s) #s /* convert to string */
6161
#define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)}
6262
#define GPR_OFFSET_NAME(num) \
63+
{.name = STR(r##num), .offset = offsetof(struct pt_regs, gpr[num])}, \
6364
{.name = STR(gpr##num), .offset = offsetof(struct pt_regs, gpr[num])}
6465
#define REG_OFFSET_END {.name = NULL, .offset = 0}
6566

0 commit comments

Comments
 (0)