Re: KPROBES: Instrumenting a function's call site

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Avishay Traeger <atraeger@...>
Cc: <prasanna@...>, <anil.s.keshavamurthy@...>, <davem@...>, <linux-kernel@...>
Date: Wednesday, September 26, 2007 - 1:27 pm

On Wed, Sep 26, 2007 at 12:09:35PM -0400, Avishay Traeger wrote:

If you single-step (regs->eflags | TF_MASK in i386) on a call instruction,
you'll end up at the call target; ie., after the post_kprobe_handler()
returns, the instruction pointer will point to the first instruction
of foo().

Try printk()ing the instruction pointer(regs) after resume_execution()
in the post_kprobe_handler() in your arch/<arch>/kernel/kprobes.c, you'll
see what I mean.

And when I say singlestepped, I mean executing one instruction under the
architecture specific single step enable flag - the "trap" flag for i386,
the MSR_SE for powerpc, etc. Evidently, this'll mean single-stepping a
single instruction.

Ananth
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
KPROBES: Instrumenting a function's call site, Avishay Traeger, (Tue Sep 25, 6:12 pm)
Re: KPROBES: Instrumenting a function's call site, Abhishek Sagar, (Wed Sep 26, 12:37 pm)
Re: KPROBES: Instrumenting a function's call site, Ananth N Mavinakayanahalli..., (Wed Sep 26, 12:39 am)
Re: KPROBES: Instrumenting a function's call site, Avishay Traeger, (Thu Nov 8, 3:42 pm)
Re: KPROBES: Instrumenting a function's call site, Ananth N Mavinakayanahalli..., (Mon Nov 12, 6:27 am)
Re: KPROBES: Instrumenting a function's call site, Keshavamurthy, Anil S, (Wed Sep 26, 1:28 pm)
Re: KPROBES: Instrumenting a function's call site, Avishay Traeger, (Wed Sep 26, 1:37 pm)
Re: KPROBES: Instrumenting a function's call site, Abhishek Sagar, (Wed Sep 26, 12:52 pm)
Re: KPROBES: Instrumenting a function's call site, Ananth N Mavinakayanahalli..., (Wed Sep 26, 5:03 am)
Re: KPROBES: Instrumenting a function's call site, Avishay Traeger, (Wed Sep 26, 12:09 pm)
Re: KPROBES: Instrumenting a function's call site, Ananth N Mavinakayanahalli..., (Wed Sep 26, 1:27 pm)
Re: KPROBES: Instrumenting a function's call site, Avishay Traeger, (Wed Sep 26, 1:35 pm)