]> git.baikalelectronics.ru Git - kernel.git/commit
kprobes: set kprobes_all_disarmed earlier to enable re-optimization.
authorWang Nan <wangnan0@huawei.com>
Fri, 13 Feb 2015 22:40:24 +0000 (14:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Feb 2015 05:21:42 +0000 (21:21 -0800)
commit2345c49f712e10a3481f395ed5de43799dff4a2d
tree2662accb1f4f5d238a56bff10d541b0797998302
parent5e4b274bb64bec08c2715c3a19c6eb66d8c08734
kprobes: set kprobes_all_disarmed earlier to enable re-optimization.

In original code, the probed instruction doesn't get optimized after

echo 0 > /sys/kernel/debug/kprobes/enabled
echo 1 > /sys/kernel/debug/kprobes/enabled

This is because original code checks kprobes_all_disarmed in
optimize_kprobe(), but this flag is turned off after calling that
function.  Therefore, optimize_kprobe() will see kprobes_all_disarmed ==
true and doesn't do the optimization.

This patch simply turns off kprobes_all_disarmed earlier to enable
optimization.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/kprobes.c