Re: [PATCH 6/6][RFC] kprobes: Allow probe on ftrace reserved text (but move it)

From: Frank Ch. Eigler
Date: Fri Apr 27 2012 - 11:30:08 EST


Steven Rostedt <rostedt@xxxxxxxxxxx> writes:

> [...]
> What do you think of this patch?
> [...]
> + /*
> + * If the address is located on a ftrace nop, set the
> + * breakpoint to the following instruction.
> + */
> + ftrace_addr = ftrace_location((unsigned long)addr);
> + if (unlikely(ftrace_addr)) {
> + addr = (kprobe_opcode_t *)(ftrace_addr + MCOUNT_INSN_SIZE);
> + p->flags |= KPROBE_FLAG_MOVED;
> + }
> [...]

I suspect Masami intended that this flag is later used during int3
processing to subtract MCOUNT_INSN_SIZE back out from the pt_regs->ip
during kprobe_handler() if this flag was set.

- FChE
--
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/