Loading Documentation/trace/ftrace-design.txt +2 −3 Original line number Diff line number Diff line Loading @@ -238,11 +238,10 @@ HAVE_SYSCALL_TRACEPOINTS You need very few things to get the syscalls tracing in an arch. - Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig). - Have a NR_syscalls variable in <asm/unistd.h> that provides the number of syscalls supported by the arch. - Implement arch_syscall_addr() that resolves a syscall address from a syscall number. - Support the TIF_SYSCALL_TRACEPOINT thread flags - Support the TIF_SYSCALL_TRACEPOINT thread flags. - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace in the ptrace syscalls tracing path. - Tag this arch as HAVE_SYSCALL_TRACEPOINTS. Loading arch/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,14 @@ config HAVE_DMA_ATTRS config USE_GENERIC_SMP_HELPERS bool config HAVE_REGS_AND_STACK_ACCESS_API bool help This symbol should be selected by an architecure if it supports the API needed to access registers and stack entries from pt_regs, declared in asm/ptrace.h For example the kprobes-based event tracer needs this API. config HAVE_CLK bool help Loading arch/s390/Kconfig +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ config S390 select HAVE_SYSCALL_TRACEPOINTS select HAVE_DYNAMIC_FTRACE select HAVE_FUNCTION_GRAPH_TRACER select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_DEFAULT_NO_SPIN_MUTEXES select HAVE_OPROFILE select HAVE_KPROBES Loading arch/s390/include/asm/ptrace.h +12 −1 Original line number Diff line number Diff line Loading @@ -492,13 +492,24 @@ struct user_regs_struct struct task_struct; extern void user_enable_single_step(struct task_struct *); extern void user_disable_single_step(struct task_struct *); extern void show_regs(struct pt_regs * regs); #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) #define user_stack_pointer(regs)((regs)->gprs[15]) #define regs_return_value(regs)((regs)->gprs[2]) #define profile_pc(regs) instruction_pointer(regs) extern void show_regs(struct pt_regs * regs); int regs_query_register_offset(const char *name); const char *regs_query_register_name(unsigned int offset); unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset); unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n); static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) { return regs->gprs[15] & PSW_ADDR_INSN; } #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ Loading arch/s390/include/asm/syscall.h +7 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ #include <linux/sched.h> #include <asm/ptrace.h> /* * The syscall table always contains 32 bit pointers since we know that the * address of the function to be called is (way) below 4GB. So the "int" * type here is what we want [need] for both 32 bit and 64 bit systems. */ extern const unsigned int sys_call_table[]; static inline long syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { Loading Loading
Documentation/trace/ftrace-design.txt +2 −3 Original line number Diff line number Diff line Loading @@ -238,11 +238,10 @@ HAVE_SYSCALL_TRACEPOINTS You need very few things to get the syscalls tracing in an arch. - Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig). - Have a NR_syscalls variable in <asm/unistd.h> that provides the number of syscalls supported by the arch. - Implement arch_syscall_addr() that resolves a syscall address from a syscall number. - Support the TIF_SYSCALL_TRACEPOINT thread flags - Support the TIF_SYSCALL_TRACEPOINT thread flags. - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace in the ptrace syscalls tracing path. - Tag this arch as HAVE_SYSCALL_TRACEPOINTS. Loading
arch/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,14 @@ config HAVE_DMA_ATTRS config USE_GENERIC_SMP_HELPERS bool config HAVE_REGS_AND_STACK_ACCESS_API bool help This symbol should be selected by an architecure if it supports the API needed to access registers and stack entries from pt_regs, declared in asm/ptrace.h For example the kprobes-based event tracer needs this API. config HAVE_CLK bool help Loading
arch/s390/Kconfig +1 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ config S390 select HAVE_SYSCALL_TRACEPOINTS select HAVE_DYNAMIC_FTRACE select HAVE_FUNCTION_GRAPH_TRACER select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_DEFAULT_NO_SPIN_MUTEXES select HAVE_OPROFILE select HAVE_KPROBES Loading
arch/s390/include/asm/ptrace.h +12 −1 Original line number Diff line number Diff line Loading @@ -492,13 +492,24 @@ struct user_regs_struct struct task_struct; extern void user_enable_single_step(struct task_struct *); extern void user_disable_single_step(struct task_struct *); extern void show_regs(struct pt_regs * regs); #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) #define user_stack_pointer(regs)((regs)->gprs[15]) #define regs_return_value(regs)((regs)->gprs[2]) #define profile_pc(regs) instruction_pointer(regs) extern void show_regs(struct pt_regs * regs); int regs_query_register_offset(const char *name); const char *regs_query_register_name(unsigned int offset); unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset); unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n); static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) { return regs->gprs[15] & PSW_ADDR_INSN; } #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ Loading
arch/s390/include/asm/syscall.h +7 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ #include <linux/sched.h> #include <asm/ptrace.h> /* * The syscall table always contains 32 bit pointers since we know that the * address of the function to be called is (way) below 4GB. So the "int" * type here is what we want [need] for both 32 bit and 64 bit systems. */ extern const unsigned int sys_call_table[]; static inline long syscall_get_nr(struct task_struct *task, struct pt_regs *regs) { Loading