OSDN Git Service

ftrace: Balance records when updating the hash
authorSteven Rostedt <srostedt@redhat.com>
Wed, 13 Jul 2011 19:03:44 +0000 (15:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2012 17:18:53 +0000 (09:18 -0800)
commitf935e6192f9e068da8f8395f032ff4b721fe8510
treed98c511790df01d7e362a50b72a169ae11008b61
parent3ce5564096c4444197e6f7dc83a9dbc63392b084
ftrace: Balance records when updating the hash

commit 41fb61c2d08107ce96a5dcb3a6289b2afd3e135c upstream.

Whenever the hash of the ftrace_ops is updated, the record counts
must be balance. This requires disabling the records that are set
in the original hash, and then enabling the records that are set
in the updated hash.

Moving the update into ftrace_hash_move() removes the bug where the
hash was updated but the records were not, which results in ftrace
triggering a warning and disabling itself because the ftrace_ops filter
is updated while the ftrace_ops was registered, and then the failure
happens when the ftrace_ops is unregistered.

The current code will not trigger this bug, but new code will.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ftrace.c