Commit 788fa4b
committed
tracing: Add guard(ring_buffer_nest)
Some calls to the tracing ring buffer can happen when the ring buffer is
already being written to by the same context (for example, a
trace_printk() in between a ring_buffer_lock_reserve() and a
ring_buffer_unlock_commit()).
In order to not trigger the recursion detection, these functions use
ring_buffer_nest_start() and ring_buffer_nest_end(). Create a guard() for
these functions so that their use cases can be simplified and not need to
use goto for the release.
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/20250801203857.710501021@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent c89504a commit 788fa4b
3 files changed
Lines changed: 34 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | | - | |
| 1163 | + | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
| 1166 | + | |
| 1167 | + | |
1170 | 1168 | | |
1171 | 1169 | | |
1172 | 1170 | | |
| |||
1182 | 1180 | | |
1183 | 1181 | | |
1184 | 1182 | | |
1185 | | - | |
1186 | | - | |
1187 | 1183 | | |
1188 | 1184 | | |
1189 | 1185 | | |
| |||
1213 | 1209 | | |
1214 | 1210 | | |
1215 | 1211 | | |
1216 | | - | |
1217 | 1212 | | |
1218 | 1213 | | |
1219 | 1214 | | |
| |||
1227 | 1222 | | |
1228 | 1223 | | |
1229 | 1224 | | |
1230 | | - | |
| 1225 | + | |
1231 | 1226 | | |
1232 | 1227 | | |
1233 | 1228 | | |
1234 | | - | |
| 1229 | + | |
1235 | 1230 | | |
1236 | 1231 | | |
1237 | 1232 | | |
| |||
1240 | 1235 | | |
1241 | 1236 | | |
1242 | 1237 | | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
| 1238 | + | |
1247 | 1239 | | |
1248 | 1240 | | |
1249 | 1241 | | |
| |||
3397 | 3389 | | |
3398 | 3390 | | |
3399 | 3391 | | |
3400 | | - | |
3401 | | - | |
3402 | | - | |
3403 | | - | |
3404 | | - | |
3405 | | - | |
3406 | | - | |
3407 | | - | |
3408 | | - | |
3409 | | - | |
3410 | | - | |
3411 | | - | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3412 | 3400 | | |
3413 | | - | |
3414 | | - | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
3415 | 3405 | | |
3416 | 3406 | | |
3417 | 3407 | | |
| |||
3452 | 3442 | | |
3453 | 3443 | | |
3454 | 3444 | | |
3455 | | - | |
3456 | | - | |
3457 | | - | |
3458 | | - | |
3459 | | - | |
3460 | | - | |
3461 | | - | |
3462 | | - | |
3463 | | - | |
3464 | | - | |
3465 | | - | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
3466 | 3452 | | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
3467 | 3457 | | |
3468 | | - | |
3469 | 3458 | | |
3470 | 3459 | | |
3471 | 3460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
588 | | - | |
589 | 587 | | |
590 | 588 | | |
591 | 589 | | |
| |||
0 commit comments