| .. | .. |
|---|
| 234 | 234 | * not add unwanted padding between the beginning of the section and the |
|---|
| 235 | 235 | * structure. Force alignment to the same alignment as the section start. |
|---|
| 236 | 236 | * |
|---|
| 237 | | - * When lockdep is enabled, we make sure to always do the RCU portions of |
|---|
| 238 | | - * the tracepoint code, regardless of whether tracing is on. However, |
|---|
| 239 | | - * don't check if the condition is false, due to interaction with idle |
|---|
| 240 | | - * instrumentation. This lets us find RCU issues triggered with tracepoints |
|---|
| 241 | | - * even when this tracepoint is off. This code has no purpose other than |
|---|
| 242 | | - * poking RCU a bit. |
|---|
| 237 | + * When lockdep is enabled, we make sure to always test if RCU is |
|---|
| 238 | + * "watching" regardless if the tracepoint is enabled or not. Tracepoints |
|---|
| 239 | + * require RCU to be active, and it should always warn at the tracepoint |
|---|
| 240 | + * site if it is not watching, as it will need to be active when the |
|---|
| 241 | + * tracepoint is enabled. |
|---|
| 243 | 242 | */ |
|---|
| 244 | 243 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
|---|
| 245 | 244 | extern int __traceiter_##name(data_proto); \ |
|---|
| .. | .. |
|---|
| 253 | 252 | TP_ARGS(data_args), \ |
|---|
| 254 | 253 | TP_CONDITION(cond), 0); \ |
|---|
| 255 | 254 | if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ |
|---|
| 256 | | - rcu_read_lock_sched_notrace(); \ |
|---|
| 257 | | - rcu_dereference_sched(__tracepoint_##name.funcs);\ |
|---|
| 258 | | - rcu_read_unlock_sched_notrace(); \ |
|---|
| 255 | + WARN_ON_ONCE(!rcu_is_watching()); \ |
|---|
| 259 | 256 | } \ |
|---|
| 260 | 257 | } \ |
|---|
| 261 | 258 | __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \ |
|---|