Re: [PATCH -tip v3 4/7] kprobes: Ignore break_handler

From: Ingo Molnar
Date: Fri May 18 2018 - 01:20:18 EST



* Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> Ignore break_handler related code because it was only
> used by jprobe and jprobe is removed.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
> ---
> Documentation/kprobes.txt | 2 +-
> kernel/kprobes.c | 39 +++++----------------------------------
> 2 files changed, 6 insertions(+), 35 deletions(-)

Even after all these changes there's quite a bit of ->break_handler() use:

triton:~/tip> git grep -w break_handler
arch/arc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
arch/arm/probes/kprobes/core.c: * for calling the break_handler below on re-entry,
arch/arm/probes/kprobes/core.c: if (cur->break_handler && cur->break_handler(cur, regs)) {
arch/arm64/kernel/probes/kprobes.c: * for calling the break_handler below on re-entry,
arch/arm64/kernel/probes/kprobes.c: if (cur_kprobe->break_handler &&
arch/arm64/kernel/probes/kprobes.c: cur_kprobe->break_handler(cur_kprobe, regs)) {
arch/ia64/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
arch/mips/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs))
arch/powerpc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
arch/s390/kernel/kprobes.c: * for calling the break_handler below on re-entry
arch/s390/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
arch/s390/kernel/kprobes.c: * break_handler "returns" to the original
arch/sh/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs)) {
arch/sh/kernel/kprobes.c: if (p->break_handler &&
arch/sh/kernel/kprobes.c: p->break_handler(p, args->regs))
arch/sparc/kernel/kprobes.c: if (p->break_handler && p->break_handler(p, regs))
arch/x86/include/asm/kprobes.h: * a post_handler or break_handler).
include/linux/kprobes.h: kprobe_break_handler_t break_handler;

Nothing appears to be actually _setting_ the break_handler, so all of this is
stale code as well which should be removed?

Thanks,

Ingo