]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tracing: Fix invalid function_graph entry
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 28 Jul 2009 12:11:24 +0000 (20:11 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Aug 2009 21:18:35 +0000 (14:18 -0700)
commit75db2222e404b259f1fd2caaeb825e8489e02a31
treea7e13c8107037f2ce43619954d5c20ac1318eb01
parent24761757735bec5aceb9f405cb6aa643765f9f78
tracing: Fix invalid function_graph entry

commit 38ceb592fcac9110c6b3c87ea0a27bff68c43486 upstream.

When print_graph_entry() computes a function call entry event, it needs
to also check the next entry to guess if it matches the return event of
the current function entry.
In order to look at this next event, it needs to consume the current
entry before going ahead in the ring buffer.

However, if the current event that gets consumed is the last one in the
ring buffer head page, the ring_buffer may reuse the page for writers.
The consumed entry will then become invalid because of possible
racy overwriting.

Me must then handle this entry by making a copy of it.

The fix also applies on 2.6.30

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4A6EEAEC.3050508@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/trace/trace_functions_graph.c