lkml.org 
[lkml]   [2014]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -tip v2 3/3] kprobes: Set IPMODIFY flag only if the probe can change regs->ip
Date
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_set_filter_ip(ops, ip, 1, 0);
> }
>
> (*ref)--;
> return 0;
> }


Hmm.. I missed removing in *ref > 1 case. Here's a v2. :)


static int __ftrace_remove_filter_ip(...)
{
int ret;

if (*ref == 1) {
ret = unregister_ftrace_function(ops);
if (ret < 0)
return ret;

/* ignore failure here */
ftrace_set_filter_ip(ops, ip, 1, 0);
} else
ret = ftrace_set_filter_ip(ops, ip, 1, 0);
if (ret < 0)
return ret;
}

(*ref)--;
return 0;
}



\
 
 \ /
  Last update: 2014-06-20 02:41    [W:0.126 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site