mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 17:43:59 +00:00
ARM: 7374/1: add TRACEHOOK support
Add calls to tracehook_report_syscall_{entry,exit} and tracehook_signal_handler Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com> Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
bf2c9f9866
commit
0693bf6814
@ -11,6 +11,7 @@ config ARM
|
|||||||
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
|
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
|
||||||
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
|
||||||
select HAVE_ARCH_KGDB
|
select HAVE_ARCH_KGDB
|
||||||
|
select HAVE_ARCH_TRACEHOOK
|
||||||
select HAVE_KPROBES if !XIP_KERNEL
|
select HAVE_KPROBES if !XIP_KERNEL
|
||||||
select HAVE_KRETPROBES if (HAVE_KPROBES)
|
select HAVE_KRETPROBES if (HAVE_KPROBES)
|
||||||
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
|
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
|
||||||
|
@ -249,6 +249,11 @@ static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
|
|||||||
return regs->ARM_sp;
|
return regs->ARM_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned long user_stack_pointer(struct pt_regs *regs)
|
||||||
|
{
|
||||||
|
return regs->ARM_sp;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <linux/hw_breakpoint.h>
|
#include <linux/hw_breakpoint.h>
|
||||||
#include <linux/regset.h>
|
#include <linux/regset.h>
|
||||||
#include <linux/audit.h>
|
#include <linux/audit.h>
|
||||||
|
#include <linux/tracehook.h>
|
||||||
|
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
#include <asm/traps.h>
|
#include <asm/traps.h>
|
||||||
@ -931,24 +932,14 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
|||||||
|
|
||||||
if (!test_thread_flag(TIF_SYSCALL_TRACE))
|
if (!test_thread_flag(TIF_SYSCALL_TRACE))
|
||||||
return scno;
|
return scno;
|
||||||
if (!(current->ptrace & PT_PTRACED))
|
|
||||||
return scno;
|
|
||||||
|
|
||||||
current_thread_info()->syscall = scno;
|
current_thread_info()->syscall = scno;
|
||||||
|
|
||||||
/* the 0x80 provides a way for the tracing parent to distinguish
|
if (why)
|
||||||
between a syscall stop and SIGTRAP delivery */
|
tracehook_report_syscall_exit(regs, 0);
|
||||||
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
|
else if (tracehook_report_syscall_entry(regs))
|
||||||
? 0x80 : 0));
|
current_thread_info()->syscall = -1;
|
||||||
/*
|
|
||||||
* this isn't the same as continuing with a signal, but it will do
|
|
||||||
* for normal use. strace only continues with a signal if the
|
|
||||||
* stopping signal is not SIGTRAP. -brl
|
|
||||||
*/
|
|
||||||
if (current->exit_code) {
|
|
||||||
send_sig(current->exit_code, current, 1);
|
|
||||||
current->exit_code = 0;
|
|
||||||
}
|
|
||||||
regs->ARM_ip = ip;
|
regs->ARM_ip = ip;
|
||||||
|
|
||||||
return current_thread_info()->syscall;
|
return current_thread_info()->syscall;
|
||||||
|
@ -636,6 +636,8 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
|
|||||||
*/
|
*/
|
||||||
block_sigmask(ka, sig);
|
block_sigmask(ka, sig);
|
||||||
|
|
||||||
|
tracehook_signal_handler(sig, info, ka, regs, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user