aboutsummaryrefslogtreecommitdiff
path: root/include/linux/trace_recursion.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2024-04-18 12:09:08 -0700
committerMasami Hiramatsu (Google) <[email protected]>2024-05-01 23:18:48 +0900
commitb0e28a4b5becea84ae6fca5cbd8a6b80a134e223 (patch)
tree436194932eee40c5eced2d6019b6d28287ffaf7a /include/linux/trace_recursion.h
parent0dc715295d4143d1659879f7f50ad4e9a6f6a99c (diff)
ftrace: make extra rcu_is_watching() validation check optional
Introduce CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING config option to control whether ftrace low-level code performs additional rcu_is_watching()-based validation logic in an attempt to catch noinstr violations. This check is expected to never be true and is mostly useful for low-level validation of ftrace subsystem invariants. For most users it should probably be kept disabled to eliminate unnecessary runtime overhead. This improves BPF multi-kretprobe (relying on ftrace and rethook infrastructure) runtime throughput by 2%, according to BPF benchmarks ([0]). [0] https://lore.kernel.org/bpf/CAEf4BzauQ2WKMjZdc9s0rBWa01BYbgwHN6aNDXQSHYia47pQ-w@mail.gmail.com/ Link: https://lore.kernel.org/all/[email protected]/ Cc: Steven Rostedt <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Paul E. McKenney <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
Diffstat (limited to 'include/linux/trace_recursion.h')
-rw-r--r--include/linux/trace_recursion.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/trace_recursion.h b/include/linux/trace_recursion.h
index d48cd92d2364..24ea8ac049b4 100644
--- a/include/linux/trace_recursion.h
+++ b/include/linux/trace_recursion.h
@@ -135,7 +135,7 @@ extern void ftrace_record_recursion(unsigned long ip, unsigned long parent_ip);
# define do_ftrace_record_recursion(ip, pip) do { } while (0)
#endif
-#ifdef CONFIG_ARCH_WANTS_NO_INSTR
+#ifdef CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING
# define trace_warn_on_no_rcu(ip) \
({ \
bool __ret = !rcu_is_watching(); \