Re: [PATCH] uprobes tracer: Add stack/memory/retval access support

From: Hyeoncheol Lee
Date: Wed Oct 17 2012 - 04:31:05 EST


2012/10/16 Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>:
> (2012/10/16 18:02), Hyeoncheol Lee wrote:
>> Event arguments except @SYM are supported. They are @ADDR,
>> $stack, $stackN, $retval, and offs(arguments).
>>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
>> Cc: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
>> Signed-off-by: Hyeoncheol Lee <hyc.lee@xxxxxxxxx>
>> ---
>
> [...]
>> #define DEFINE_FETCH_stack(type) \
>> static __kprobes void FETCH_FUNC_NAME(stack, type)(struct pt_regs *regs,\
>> - void *offset, void *dest) \
>> + void *offset, void *dest, \
>> + bool kprobe) \
>> { \
>> - *(type *)dest = (type)regs_get_kernel_stack_nth(regs, \
>> + if (kprobe) \
>> + *(type *)dest = (type)regs_get_kernel_stack_nth(regs, \
>> (unsigned int)((unsigned long)offset)); \
>> + else \
>> + *(type *)dest = (type)regs_get_user_stack_nth(regs, \
>> + (unsigned int)((unsigned long)offset)); \
>> }
>
>
> Hmm, I don't think this is a good way to do that.
> If fetching user space objects is different from the kernel one,
> we'd better introduce new fetch handlers for it, instead of checking
> a bool flag every time, because it will be done on every events.
>
> Thank you,
>
>
> --
> Masami HIRAMATSU
> IT Management Research Dept. Linux Technology Center
> Hitachi, Ltd., Yokohama Research Laboratory
> E-mail: masami.hiramatsu.pt@xxxxxxxxxxx
>
>

Yes
Thank you for your comment
--
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/