lkml.org 
[lkml]   [2014]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ftrace: Do not copy old hash when resetting.
Hi Steve,

What's your opinion on my v2 patch ( https://lkml.org/lkml/2014/7/14/839 )?

I have swapped if consitions following your suggestion.

On 2014/7/14 12:10, Wang Nan wrote:
> If we are going to reset hash, we don't need to duplicate old hash
> and remove every entries right after allocation.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> ---
> kernel/trace/ftrace.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 5b372e3..52d6931 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -3471,14 +3471,16 @@ ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len,
> else
> orig_hash = &ops->notrace_hash;
>
> - hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash);
> + if (!reset)
> + hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, *orig_hash);
> + else
> + hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS);
> +
> if (!hash) {
> ret = -ENOMEM;
> goto out_regex_unlock;
> }
>
> - if (reset)
> - ftrace_filter_reset(hash);
> if (buf && !ftrace_match_records(hash, buf, len)) {
> ret = -EINVAL;
> goto out_regex_unlock;
>




\
 
 \ /
  Last update: 2014-07-18 08:21    [W:0.114 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site