Re: [PATCH -tip v2 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip

2014-06-19 Thread Masami Hiramatsu
(2014/06/19 21:34), Namhyung Kim wrote: > Hi Masami, > > 2014-06-17 (화), 11:04 +, Masami Hiramatsu: >> +static int __ftrace_add_filter_ip(struct ftrace_ops *ops, unsigned long ip, >> + int *ref) >> +{ >> +int ret; >> + >> +/* Try to set given ip to filter *

Re: [PATCH -tip v2 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip

2014-06-19 Thread Namhyung Kim
On Thu, 19 Jun 2014 21:34:31 +0900, Namhyung Kim wrote: > What about this? > > static int __ftrace_remove_filter_ip(...) > { > if (*ref == 1) { > int ret = unregister_ftrace_function(ops); > if (ret < 0) > return ret; > > ftrace_

Re: [PATCH -tip v2 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip

2014-06-19 Thread Namhyung Kim
Hi Masami, 2014-06-17 (화), 11:04 +, Masami Hiramatsu: > +static int __ftrace_add_filter_ip(struct ftrace_ops *ops, unsigned long ip, > + int *ref) > +{ > + int ret; > + > + /* Try to set given ip to filter */ > + ret = ftrace_set_filter_ip(ops, ip, 0,

[PATCH -tip v2 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip

2014-06-17 Thread Masami Hiramatsu
Set FTRACE_OPS_FL_IPMODIFY flag only for the probes which can change regs->ip, which has kprobe->break_handler. Currently only jprobe modifies regs->ip to hook a function entry and jumps to a user handler which has same prototype of the original function. In other cases, kprobes restores original