From: Ingo Molnar on

* Masami Hiramatsu <mhiramat(a)redhat.com> wrote:

> config OPTPROBES
> - bool "Kprobes jump optimization support (EXPERIMENTAL)"
> - default y
> - depends on KPROBES
> + def_bool y
> + depends on KPROBES && HAVE_OPTPROBES
> depends on !PREEMPT
> - depends on HAVE_OPTPROBES
> select KALLSYMS_ALL
> help
> This option will allow kprobes to optimize breakpoint to

The help text can be removed too, now that it's not interactive. Also, i'd
suggest to add a comment that this just relays HAVE_OPTPROBES now, set by the
arch.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Masami Hiramatsu on
OGAWA Hirofumi wrote:
> Masami Hiramatsu <mhiramat(a)redhat.com> writes:
>
>> Hide CONFIG_OPTPROBES and set if arch support optimized kprobes, since
>> this option doesn't change the behavior of kprobes, but just reduces
>> the overhead.
>
> I don't so care whether this is configurable or not, but this confuses
> me now. The following seems to say it's changed, but now this comment
> says it wasn't changed. The following docs was obsoleted?
>
> Thanks.
>
> NOTE for geeks:
> The jump optimization changes the kprobe's pre_handler behavior.
> Without optimization, the pre_handler can change the kernel's execution
> path by changing regs->ip and returning 1. However, when the probe
> is optimized, that modification is ignored. Thus, if you want to
> tweak the kernel's execution path, you need to suppress optimization,
> using one of the following techniques:

Ah, good point. This is only one point of changing the behavior.
So if someone makes an out of tree module for changing the ip
address by using kprobes, e.g. live code patching or something
like that, it will be affected by this change.
However, I think using kprobes for this way is not obviously
documented, moreover, some workarounds for that are documented
as above. So I don't worried about it.

Anyway, indeed, the patch comment is wrong. I need to say "this option
doesn't change the major behavior of kprobes, and workarounds for minor
change are documented." :)

Thank you for pointing it out!


--
Masami Hiramatsu
e-mail: mhiramat(a)redhat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/