[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878unrkzag.fsf@sejong.aot.lge.com>
Date: Fri, 18 Jul 2014 14:32:07 +0900
From: Namhyung Kim <namhyung@...il.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH ftrace/core v3 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip
Hi Masami,
On Tue, 15 Jul 2014 06:00:35 +0000, Masami Hiramatsu wrote:
> +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, 0);
> + if (ret < 0)
> + return ret;
> +
> + (*ref)++;
> + if (*ref == 1) {
> + ret = register_ftrace_function(ops);
> + if (ret < 0) {
> + /* Rollback refcounter and filter */
> + (*ref)--;
> + ftrace_set_filter_ip(ops, ip, 1, 0);
> + }
> + }
> +
> + return ret;
> +}
This function also can be changed in a similar way:
if (*ref == 0) {
ret = register_ftrace_function(ops);
if (ret < 0) {
/* Rollback filter if failed */
ftrace_set_filter_ip(ops, ip, 1, 0);
return ret;
}
}
(*ref)++;
return 0;
Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists