Re: CONFIG_HAVE_ARCH_TRACEHOOK and you

From: Paul Mundt
Date: Fri Sep 12 2008 - 09:06:08 EST


On Thu, Sep 11, 2008 at 07:57:33PM -0700, Roland McGrath wrote:
> The comment in arch/Kconfig lists the items:
>
> # task_pt_regs() in asm/processor.h or asm/ptrace.h
> # arch_has_single_step() if there is hardware single-step support
> # arch_has_block_step() if there is hardware block-step support
> # arch_ptrace() and not #define __ARCH_SYS_PTRACE
> # compat_arch_ptrace() and #define __ARCH_WANT_COMPAT_SYS_PTRACE
> # asm/syscall.h supplying asm-generic/syscall.h interface
> # linux/regset.h user_regset interfaces
> # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
> # TIF_SYSCALL_TRACE calls tracehook_report_syscall_{entry,exit}
> # TIF_NOTIFY_RESUME calls tracehook_notify_resume()
> # signal delivery calls tracehook_signal_handler()
>
[snip]

> Here's the text that's on that wiki:
>
> 1. task_pt_regs()
>
> * Define this inline function in asm/processor.h or asm/ptrace.h.
>
user_stack_pointer() is apparently a requirement, too. Although given
that you already have a task_struct pointer the only place you currently
use it (lib/syscall.c), it makes more sense to use KSTK_ESP/KSTK_EIP
which is provided by almost everyone already.

Signed-off-by: Paul Mundt <lethal@xxxxxxxxxxxx>

---

lib/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/syscall.c b/lib/syscall.c
index a4f7067..888c36a 100644
--- a/lib/syscall.c
+++ b/lib/syscall.c
@@ -11,8 +11,8 @@ static int collect_syscall(struct task_struct *target, long *callno,
if (unlikely(!regs))
return -EAGAIN;

- *sp = user_stack_pointer(regs);
- *pc = instruction_pointer(regs);
+ *sp = KSTK_ESP(target);
+ *pc = KSTK_EIP(target);

*callno = syscall_get_nr(target, regs);
if (*callno != -1L && maxargs > 0)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/