Message ID | 20220209021745.2215452-9-iii@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 60d16c5ccb811c9817bb0a71644b9ba14115f68e |
Delegated to: | BPF |
Headers | show |
Series | Fix accessing syscall arguments | expand |
On Tue, Feb 8, 2022 at 6:18 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote: > > arm64 and s390 need a special way to access the first syscall argument. > > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> > --- > tools/lib/bpf/bpf_tracing.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h > index 41a015ee6bfb..f364f1f4710e 100644 > --- a/tools/lib/bpf/bpf_tracing.h > +++ b/tools/lib/bpf/bpf_tracing.h > @@ -269,7 +269,9 @@ struct pt_regs; > > #endif > > +#ifndef PT_REGS_PARM1_SYSCALL > #define PT_REGS_PARM1_SYSCALL(x) PT_REGS_PARM1(x) > +#endif > #define PT_REGS_PARM2_SYSCALL(x) PT_REGS_PARM2(x) > #define PT_REGS_PARM3_SYSCALL(x) PT_REGS_PARM3(x) > #ifdef __PT_PARM4_REG_SYSCALL > @@ -279,7 +281,9 @@ struct pt_regs; > #endif > #define PT_REGS_PARM5_SYSCALL(x) PT_REGS_PARM5(x) > > +#ifndef PT_REGS_PARM1_CORE_SYSCALL > #define PT_REGS_PARM1_CORE_SYSCALL(x) PT_REGS_PARM1_CORE(x) > +#endif > #define PT_REGS_PARM2_CORE_SYSCALL(x) PT_REGS_PARM2_CORE(x) > #define PT_REGS_PARM3_CORE_SYSCALL(x) PT_REGS_PARM3_CORE(x) > #ifdef __PT_PARM4_REG_SYSCALL I've changed PARM4 handling to be the same as for PARM1 for consistency (and flexibility, if we ever need as much) > -- > 2.34.1 >
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index 41a015ee6bfb..f364f1f4710e 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -269,7 +269,9 @@ struct pt_regs; #endif +#ifndef PT_REGS_PARM1_SYSCALL #define PT_REGS_PARM1_SYSCALL(x) PT_REGS_PARM1(x) +#endif #define PT_REGS_PARM2_SYSCALL(x) PT_REGS_PARM2(x) #define PT_REGS_PARM3_SYSCALL(x) PT_REGS_PARM3(x) #ifdef __PT_PARM4_REG_SYSCALL @@ -279,7 +281,9 @@ struct pt_regs; #endif #define PT_REGS_PARM5_SYSCALL(x) PT_REGS_PARM5(x) +#ifndef PT_REGS_PARM1_CORE_SYSCALL #define PT_REGS_PARM1_CORE_SYSCALL(x) PT_REGS_PARM1_CORE(x) +#endif #define PT_REGS_PARM2_CORE_SYSCALL(x) PT_REGS_PARM2_CORE(x) #define PT_REGS_PARM3_CORE_SYSCALL(x) PT_REGS_PARM3_CORE(x) #ifdef __PT_PARM4_REG_SYSCALL
arm64 and s390 need a special way to access the first syscall argument. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- tools/lib/bpf/bpf_tracing.h | 4 ++++ 1 file changed, 4 insertions(+)