]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Reuse logic from perf's get_recursion_context()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 15 Oct 2021 17:42:40 +0000 (13:42 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 20 Oct 2021 00:33:20 +0000 (20:33 -0400)
commit0010a3dffa31e327d4c93d09f260c04ea781cc7a
tree0bbafa429f2728795926fbe1b152ea2415a339f0
parenta398ae16ad84a7c1a30da46563666e7af63dff83
tracing: Reuse logic from perf's get_recursion_context()

Instead of having branches that adds noise to the branch prediction, use
the addition logic to set the bit for the level of interrupt context that
the state is currently in. This copies the logic from perf's
get_recursion_context() function.

Link: https://lore.kernel.org/all/20211015161702.GF174703@worktop.programming.kicks-ass.net/
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/trace_recursion.h
kernel/trace/ring_buffer.c