tracing: Allocate the ftrace event profile buffer dynamically
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 17 lines · tip-bot for Frederic Weisbecker
Commit-ID: 20ab4425a77a1f34028cc6ce57053c22c184ba5f Gitweb: http://git.kernel.org/tip/20ab4425a77a1f34028cc6ce57053c22c184ba5f Author: Frederic Weisbecker <[email protected]> AuthorDate: Fri, 18 Sep 2009 06:10:28 +0200 Committer: Frederic Weisbecker <[email protected]> CommitDate: Fri, 18 Sep 2009 07:25:44 +0200tracing: Allocate the ftrace event profile buffer dynamically
Currently the trace event profile buffer is allocated in the stack. But this may be too much for the stack, as the events can have large statically defined field size and can also grow with dynamic arrays.
Allocate two per cpu buffer for all profiled events. The first cpu buffer is used to host every non-nmi context traces. It is protected by disabling the interrupts while writing and committing the trace.
Quoted 8 lines
The second buffer is reserved for nmi. So that there is no race between them and the first buffer.
The whole write/commit section is rcu protected because we release these buffers while deactivating the last profiling trace event.
v2: Move the buffers from
trace_eventto be global, as pointed by
Steven Rostedt.
OK, now I'm confused ;-)
This version looks like the correct one.
-- Steve
Quoted 13 lines
v3: Fix the syscall events to handle the profiling buffer races
by disabling interrupts, now that the buffers are globals.Suggested-by Steven Rostedt <[email protected]>Signed-off-by Frederic Weisbecker <[email protected]>Cc Steven Rostedt <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Li Zefan <[email protected]>Cc Jason Baron <[email protected]>Cc Masami Hiramatsu <[email protected]>Cc Ingo Molnar <[email protected]>