lkml.org 
[lkml]   [2013]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/18 v2] ftrace: Add hash list to save RCU unsafe functions
On Sat, 31 Aug 2013 01:11:18 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:


> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index a6d098c..3750360 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1356,6 +1356,23 @@ ftrace_hash_rec_disable(struct ftrace_ops *ops, int filter_hash);
> static void
> ftrace_hash_rec_enable(struct ftrace_ops *ops, int filter_hash);
>
> +static int ftrace_convert_size_to_bits(int size)
> +{
> + int bits;
> +
> + /*
> + * Make the hash size about 1/2 the # found
> + */
> + for (size /= 2; size; size >>= 1)
> + bits++;
> +
> + /* Don't allocate too much */
> + if (bits > FTRACE_HASH_MAX_BITS)
> + bits = FTRACE_HASH_MAX_BITS;
> +
> + return bits;
> +}
> +


Just found this bug. Strange that gcc never gave me a warning :-/

-- Steve


\
 
 \ /
  Last update: 2013-09-03 23:41    [W:0.236 / U:1.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site