| .. | .. |
|---|
| 7 | 7 | |
|---|
| 8 | 8 | #include <linux/tracepoint.h> |
|---|
| 9 | 9 | |
|---|
| 10 | +#ifdef CONFIG_RCU_TRACE |
|---|
| 11 | +#define TRACE_EVENT_RCU TRACE_EVENT |
|---|
| 12 | +#else |
|---|
| 13 | +#define TRACE_EVENT_RCU TRACE_EVENT_NOP |
|---|
| 14 | +#endif |
|---|
| 15 | + |
|---|
| 10 | 16 | /* |
|---|
| 11 | 17 | * Tracepoint for start/end markers used for utilization calculations. |
|---|
| 12 | 18 | * By convention, the string is of the following forms: |
|---|
| .. | .. |
|---|
| 35 | 41 | TP_printk("%s", __entry->s) |
|---|
| 36 | 42 | ); |
|---|
| 37 | 43 | |
|---|
| 38 | | -#ifdef CONFIG_RCU_TRACE |
|---|
| 39 | | - |
|---|
| 40 | | -#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) |
|---|
| 44 | +#if defined(CONFIG_TREE_RCU) |
|---|
| 41 | 45 | |
|---|
| 42 | 46 | /* |
|---|
| 43 | 47 | * Tracepoint for grace-period events. Takes a string identifying the |
|---|
| .. | .. |
|---|
| 62 | 66 | * "end": End a grace period. |
|---|
| 63 | 67 | * "cpuend": CPU first notices a grace-period end. |
|---|
| 64 | 68 | */ |
|---|
| 65 | | -TRACE_EVENT(rcu_grace_period, |
|---|
| 69 | +TRACE_EVENT_RCU(rcu_grace_period, |
|---|
| 66 | 70 | |
|---|
| 67 | 71 | TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent), |
|---|
| 68 | 72 | |
|---|
| .. | .. |
|---|
| 70 | 74 | |
|---|
| 71 | 75 | TP_STRUCT__entry( |
|---|
| 72 | 76 | __field(const char *, rcuname) |
|---|
| 73 | | - __field(unsigned long, gp_seq) |
|---|
| 77 | + __field(long, gp_seq) |
|---|
| 74 | 78 | __field(const char *, gpevent) |
|---|
| 75 | 79 | ), |
|---|
| 76 | 80 | |
|---|
| 77 | 81 | TP_fast_assign( |
|---|
| 78 | 82 | __entry->rcuname = rcuname; |
|---|
| 79 | | - __entry->gp_seq = gp_seq; |
|---|
| 83 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 80 | 84 | __entry->gpevent = gpevent; |
|---|
| 81 | 85 | ), |
|---|
| 82 | 86 | |
|---|
| 83 | | - TP_printk("%s %lu %s", |
|---|
| 87 | + TP_printk("%s %ld %s", |
|---|
| 84 | 88 | __entry->rcuname, __entry->gp_seq, __entry->gpevent) |
|---|
| 85 | 89 | ); |
|---|
| 86 | 90 | |
|---|
| .. | .. |
|---|
| 89 | 93 | * the data from the rcu_node structure, other than rcuname, which comes |
|---|
| 90 | 94 | * from the rcu_state structure, and event, which is one of the following: |
|---|
| 91 | 95 | * |
|---|
| 92 | | - * "Startleaf": Request a grace period based on leaf-node data. |
|---|
| 96 | + * "Cleanup": Clean up rcu_node structure after previous GP. |
|---|
| 97 | + * "CleanupMore": Clean up, and another GP is needed. |
|---|
| 98 | + * "EndWait": Complete wait. |
|---|
| 99 | + * "NoGPkthread": The RCU grace-period kthread has not yet started. |
|---|
| 93 | 100 | * "Prestarted": Someone beat us to the request |
|---|
| 94 | 101 | * "Startedleaf": Leaf node marked for future GP. |
|---|
| 95 | 102 | * "Startedleafroot": All nodes from leaf to root marked for future GP. |
|---|
| 96 | 103 | * "Startedroot": Requested a nocb grace period based on root-node data. |
|---|
| 97 | | - * "NoGPkthread": The RCU grace-period kthread has not yet started. |
|---|
| 104 | + * "Startleaf": Request a grace period based on leaf-node data. |
|---|
| 98 | 105 | * "StartWait": Start waiting for the requested grace period. |
|---|
| 99 | | - * "ResumeWait": Resume waiting after signal. |
|---|
| 100 | | - * "EndWait": Complete wait. |
|---|
| 101 | | - * "Cleanup": Clean up rcu_node structure after previous GP. |
|---|
| 102 | | - * "CleanupMore": Clean up, and another GP is needed. |
|---|
| 103 | 106 | */ |
|---|
| 104 | | -TRACE_EVENT(rcu_future_grace_period, |
|---|
| 107 | +TRACE_EVENT_RCU(rcu_future_grace_period, |
|---|
| 105 | 108 | |
|---|
| 106 | 109 | TP_PROTO(const char *rcuname, unsigned long gp_seq, |
|---|
| 107 | 110 | unsigned long gp_seq_req, u8 level, int grplo, int grphi, |
|---|
| .. | .. |
|---|
| 111 | 114 | |
|---|
| 112 | 115 | TP_STRUCT__entry( |
|---|
| 113 | 116 | __field(const char *, rcuname) |
|---|
| 114 | | - __field(unsigned long, gp_seq) |
|---|
| 115 | | - __field(unsigned long, gp_seq_req) |
|---|
| 117 | + __field(long, gp_seq) |
|---|
| 118 | + __field(long, gp_seq_req) |
|---|
| 116 | 119 | __field(u8, level) |
|---|
| 117 | 120 | __field(int, grplo) |
|---|
| 118 | 121 | __field(int, grphi) |
|---|
| .. | .. |
|---|
| 121 | 124 | |
|---|
| 122 | 125 | TP_fast_assign( |
|---|
| 123 | 126 | __entry->rcuname = rcuname; |
|---|
| 124 | | - __entry->gp_seq = gp_seq; |
|---|
| 125 | | - __entry->gp_seq_req = gp_seq_req; |
|---|
| 127 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 128 | + __entry->gp_seq_req = (long)gp_seq_req; |
|---|
| 126 | 129 | __entry->level = level; |
|---|
| 127 | 130 | __entry->grplo = grplo; |
|---|
| 128 | 131 | __entry->grphi = grphi; |
|---|
| 129 | 132 | __entry->gpevent = gpevent; |
|---|
| 130 | 133 | ), |
|---|
| 131 | 134 | |
|---|
| 132 | | - TP_printk("%s %lu %lu %u %d %d %s", |
|---|
| 133 | | - __entry->rcuname, __entry->gp_seq, __entry->gp_seq_req, __entry->level, |
|---|
| 135 | + TP_printk("%s %ld %ld %u %d %d %s", |
|---|
| 136 | + __entry->rcuname, (long)__entry->gp_seq, (long)__entry->gp_seq_req, __entry->level, |
|---|
| 134 | 137 | __entry->grplo, __entry->grphi, __entry->gpevent) |
|---|
| 135 | 138 | ); |
|---|
| 136 | 139 | |
|---|
| .. | .. |
|---|
| 141 | 144 | * rcu_node structure, and the mask of CPUs that will be waited for. |
|---|
| 142 | 145 | * All but the type of RCU are extracted from the rcu_node structure. |
|---|
| 143 | 146 | */ |
|---|
| 144 | | -TRACE_EVENT(rcu_grace_period_init, |
|---|
| 147 | +TRACE_EVENT_RCU(rcu_grace_period_init, |
|---|
| 145 | 148 | |
|---|
| 146 | 149 | TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level, |
|---|
| 147 | 150 | int grplo, int grphi, unsigned long qsmask), |
|---|
| .. | .. |
|---|
| 150 | 153 | |
|---|
| 151 | 154 | TP_STRUCT__entry( |
|---|
| 152 | 155 | __field(const char *, rcuname) |
|---|
| 153 | | - __field(unsigned long, gp_seq) |
|---|
| 156 | + __field(long, gp_seq) |
|---|
| 154 | 157 | __field(u8, level) |
|---|
| 155 | 158 | __field(int, grplo) |
|---|
| 156 | 159 | __field(int, grphi) |
|---|
| .. | .. |
|---|
| 159 | 162 | |
|---|
| 160 | 163 | TP_fast_assign( |
|---|
| 161 | 164 | __entry->rcuname = rcuname; |
|---|
| 162 | | - __entry->gp_seq = gp_seq; |
|---|
| 165 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 163 | 166 | __entry->level = level; |
|---|
| 164 | 167 | __entry->grplo = grplo; |
|---|
| 165 | 168 | __entry->grphi = grphi; |
|---|
| 166 | 169 | __entry->qsmask = qsmask; |
|---|
| 167 | 170 | ), |
|---|
| 168 | 171 | |
|---|
| 169 | | - TP_printk("%s %lu %u %d %d %lx", |
|---|
| 172 | + TP_printk("%s %ld %u %d %d %lx", |
|---|
| 170 | 173 | __entry->rcuname, __entry->gp_seq, __entry->level, |
|---|
| 171 | 174 | __entry->grplo, __entry->grphi, __entry->qsmask) |
|---|
| 172 | 175 | ); |
|---|
| .. | .. |
|---|
| 186 | 189 | * "endwake": Woke piggybackers up. |
|---|
| 187 | 190 | * "done": Someone else did the expedited grace period for us. |
|---|
| 188 | 191 | */ |
|---|
| 189 | | -TRACE_EVENT(rcu_exp_grace_period, |
|---|
| 192 | +TRACE_EVENT_RCU(rcu_exp_grace_period, |
|---|
| 190 | 193 | |
|---|
| 191 | 194 | TP_PROTO(const char *rcuname, unsigned long gpseq, const char *gpevent), |
|---|
| 192 | 195 | |
|---|
| .. | .. |
|---|
| 194 | 197 | |
|---|
| 195 | 198 | TP_STRUCT__entry( |
|---|
| 196 | 199 | __field(const char *, rcuname) |
|---|
| 197 | | - __field(unsigned long, gpseq) |
|---|
| 200 | + __field(long, gpseq) |
|---|
| 198 | 201 | __field(const char *, gpevent) |
|---|
| 199 | 202 | ), |
|---|
| 200 | 203 | |
|---|
| 201 | 204 | TP_fast_assign( |
|---|
| 202 | 205 | __entry->rcuname = rcuname; |
|---|
| 203 | | - __entry->gpseq = gpseq; |
|---|
| 206 | + __entry->gpseq = (long)gpseq; |
|---|
| 204 | 207 | __entry->gpevent = gpevent; |
|---|
| 205 | 208 | ), |
|---|
| 206 | 209 | |
|---|
| 207 | | - TP_printk("%s %lu %s", |
|---|
| 210 | + TP_printk("%s %ld %s", |
|---|
| 208 | 211 | __entry->rcuname, __entry->gpseq, __entry->gpevent) |
|---|
| 209 | 212 | ); |
|---|
| 210 | 213 | |
|---|
| .. | .. |
|---|
| 218 | 221 | * "nxtlvl": Advance to next level of rcu_node funnel |
|---|
| 219 | 222 | * "wait": Wait for someone else to do expedited GP |
|---|
| 220 | 223 | */ |
|---|
| 221 | | -TRACE_EVENT(rcu_exp_funnel_lock, |
|---|
| 224 | +TRACE_EVENT_RCU(rcu_exp_funnel_lock, |
|---|
| 222 | 225 | |
|---|
| 223 | 226 | TP_PROTO(const char *rcuname, u8 level, int grplo, int grphi, |
|---|
| 224 | 227 | const char *gpevent), |
|---|
| .. | .. |
|---|
| 255 | 258 | * the number of the offloaded CPU are extracted. The third and final |
|---|
| 256 | 259 | * argument is a string as follows: |
|---|
| 257 | 260 | * |
|---|
| 258 | | - * "WakeEmpty": Wake rcuo kthread, first CB to empty list. |
|---|
| 259 | | - * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list. |
|---|
| 260 | | - * "WakeOvf": Wake rcuo kthread, CB list is huge. |
|---|
| 261 | | - * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge. |
|---|
| 262 | | - * "WakeNot": Don't wake rcuo kthread. |
|---|
| 263 | | - * "WakeNotPoll": Don't wake rcuo kthread because it is polling. |
|---|
| 264 | | - * "DeferredWake": Carried out the "IsDeferred" wakeup. |
|---|
| 265 | | - * "Poll": Start of new polling cycle for rcu_nocb_poll. |
|---|
| 266 | | - * "Sleep": Sleep waiting for CBs for !rcu_nocb_poll. |
|---|
| 267 | | - * "WokeEmpty": rcuo kthread woke to find empty list. |
|---|
| 268 | | - * "WokeNonEmpty": rcuo kthread woke to find non-empty list. |
|---|
| 269 | | - * "WaitQueue": Enqueue partially done, timed wait for it to complete. |
|---|
| 270 | | - * "WokeQueue": Partial enqueue now complete. |
|---|
| 261 | + * "AlreadyAwake": The to-be-awakened rcuo kthread is already awake. |
|---|
| 262 | + * "Bypass": rcuo GP kthread sees non-empty ->nocb_bypass. |
|---|
| 263 | + * "CBSleep": rcuo CB kthread sleeping waiting for CBs. |
|---|
| 264 | + * "Check": rcuo GP kthread checking specified CPU for work. |
|---|
| 265 | + * "DeferredWake": Timer expired or polled check, time to wake. |
|---|
| 266 | + * "DoWake": The to-be-awakened rcuo kthread needs to be awakened. |
|---|
| 267 | + * "EndSleep": Done waiting for GP for !rcu_nocb_poll. |
|---|
| 268 | + * "FirstBQ": New CB to empty ->nocb_bypass (->cblist maybe non-empty). |
|---|
| 269 | + * "FirstBQnoWake": FirstBQ plus rcuo kthread need not be awakened. |
|---|
| 270 | + * "FirstBQwake": FirstBQ plus rcuo kthread must be awakened. |
|---|
| 271 | + * "FirstQ": New CB to empty ->cblist (->nocb_bypass maybe non-empty). |
|---|
| 272 | + * "NeedWaitGP": rcuo GP kthread must wait on a grace period. |
|---|
| 273 | + * "Poll": Start of new polling cycle for rcu_nocb_poll. |
|---|
| 274 | + * "Sleep": Sleep waiting for GP for !rcu_nocb_poll. |
|---|
| 275 | + * "Timer": Deferred-wake timer expired. |
|---|
| 276 | + * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list. |
|---|
| 277 | + * "WakeEmpty": Wake rcuo kthread, first CB to empty list. |
|---|
| 278 | + * "WakeNot": Don't wake rcuo kthread. |
|---|
| 279 | + * "WakeNotPoll": Don't wake rcuo kthread because it is polling. |
|---|
| 280 | + * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge. |
|---|
| 281 | + * "WokeEmpty": rcuo CB kthread woke to find empty list. |
|---|
| 271 | 282 | */ |
|---|
| 272 | | -TRACE_EVENT(rcu_nocb_wake, |
|---|
| 283 | +TRACE_EVENT_RCU(rcu_nocb_wake, |
|---|
| 273 | 284 | |
|---|
| 274 | 285 | TP_PROTO(const char *rcuname, int cpu, const char *reason), |
|---|
| 275 | 286 | |
|---|
| .. | .. |
|---|
| 297 | 308 | * include SRCU), the grace-period number that the task is blocking |
|---|
| 298 | 309 | * (the current or the next), and the task's PID. |
|---|
| 299 | 310 | */ |
|---|
| 300 | | -TRACE_EVENT(rcu_preempt_task, |
|---|
| 311 | +TRACE_EVENT_RCU(rcu_preempt_task, |
|---|
| 301 | 312 | |
|---|
| 302 | 313 | TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq), |
|---|
| 303 | 314 | |
|---|
| .. | .. |
|---|
| 305 | 316 | |
|---|
| 306 | 317 | TP_STRUCT__entry( |
|---|
| 307 | 318 | __field(const char *, rcuname) |
|---|
| 308 | | - __field(unsigned long, gp_seq) |
|---|
| 319 | + __field(long, gp_seq) |
|---|
| 309 | 320 | __field(int, pid) |
|---|
| 310 | 321 | ), |
|---|
| 311 | 322 | |
|---|
| 312 | 323 | TP_fast_assign( |
|---|
| 313 | 324 | __entry->rcuname = rcuname; |
|---|
| 314 | | - __entry->gp_seq = gp_seq; |
|---|
| 325 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 315 | 326 | __entry->pid = pid; |
|---|
| 316 | 327 | ), |
|---|
| 317 | 328 | |
|---|
| 318 | | - TP_printk("%s %lu %d", |
|---|
| 329 | + TP_printk("%s %ld %d", |
|---|
| 319 | 330 | __entry->rcuname, __entry->gp_seq, __entry->pid) |
|---|
| 320 | 331 | ); |
|---|
| 321 | 332 | |
|---|
| .. | .. |
|---|
| 324 | 335 | * read-side critical section exiting that critical section. Track the |
|---|
| 325 | 336 | * type of RCU (which one day might include SRCU) and the task's PID. |
|---|
| 326 | 337 | */ |
|---|
| 327 | | -TRACE_EVENT(rcu_unlock_preempted_task, |
|---|
| 338 | +TRACE_EVENT_RCU(rcu_unlock_preempted_task, |
|---|
| 328 | 339 | |
|---|
| 329 | 340 | TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid), |
|---|
| 330 | 341 | |
|---|
| .. | .. |
|---|
| 332 | 343 | |
|---|
| 333 | 344 | TP_STRUCT__entry( |
|---|
| 334 | 345 | __field(const char *, rcuname) |
|---|
| 335 | | - __field(unsigned long, gp_seq) |
|---|
| 346 | + __field(long, gp_seq) |
|---|
| 336 | 347 | __field(int, pid) |
|---|
| 337 | 348 | ), |
|---|
| 338 | 349 | |
|---|
| 339 | 350 | TP_fast_assign( |
|---|
| 340 | 351 | __entry->rcuname = rcuname; |
|---|
| 341 | | - __entry->gp_seq = gp_seq; |
|---|
| 352 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 342 | 353 | __entry->pid = pid; |
|---|
| 343 | 354 | ), |
|---|
| 344 | 355 | |
|---|
| 345 | | - TP_printk("%s %lu %d", __entry->rcuname, __entry->gp_seq, __entry->pid) |
|---|
| 356 | + TP_printk("%s %ld %d", __entry->rcuname, __entry->gp_seq, __entry->pid) |
|---|
| 346 | 357 | ); |
|---|
| 347 | 358 | |
|---|
| 348 | 359 | /* |
|---|
| .. | .. |
|---|
| 353 | 364 | * whether there are any blocked tasks blocking the current grace period. |
|---|
| 354 | 365 | * All but the type of RCU are extracted from the rcu_node structure. |
|---|
| 355 | 366 | */ |
|---|
| 356 | | -TRACE_EVENT(rcu_quiescent_state_report, |
|---|
| 367 | +TRACE_EVENT_RCU(rcu_quiescent_state_report, |
|---|
| 357 | 368 | |
|---|
| 358 | 369 | TP_PROTO(const char *rcuname, unsigned long gp_seq, |
|---|
| 359 | 370 | unsigned long mask, unsigned long qsmask, |
|---|
| .. | .. |
|---|
| 363 | 374 | |
|---|
| 364 | 375 | TP_STRUCT__entry( |
|---|
| 365 | 376 | __field(const char *, rcuname) |
|---|
| 366 | | - __field(unsigned long, gp_seq) |
|---|
| 377 | + __field(long, gp_seq) |
|---|
| 367 | 378 | __field(unsigned long, mask) |
|---|
| 368 | 379 | __field(unsigned long, qsmask) |
|---|
| 369 | 380 | __field(u8, level) |
|---|
| .. | .. |
|---|
| 374 | 385 | |
|---|
| 375 | 386 | TP_fast_assign( |
|---|
| 376 | 387 | __entry->rcuname = rcuname; |
|---|
| 377 | | - __entry->gp_seq = gp_seq; |
|---|
| 388 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 378 | 389 | __entry->mask = mask; |
|---|
| 379 | 390 | __entry->qsmask = qsmask; |
|---|
| 380 | 391 | __entry->level = level; |
|---|
| .. | .. |
|---|
| 383 | 394 | __entry->gp_tasks = gp_tasks; |
|---|
| 384 | 395 | ), |
|---|
| 385 | 396 | |
|---|
| 386 | | - TP_printk("%s %lu %lx>%lx %u %d %d %u", |
|---|
| 397 | + TP_printk("%s %ld %lx>%lx %u %d %d %u", |
|---|
| 387 | 398 | __entry->rcuname, __entry->gp_seq, |
|---|
| 388 | 399 | __entry->mask, __entry->qsmask, __entry->level, |
|---|
| 389 | 400 | __entry->grplo, __entry->grphi, __entry->gp_tasks) |
|---|
| .. | .. |
|---|
| 393 | 404 | * Tracepoint for quiescent states detected by force_quiescent_state(). |
|---|
| 394 | 405 | * These trace events include the type of RCU, the grace-period number |
|---|
| 395 | 406 | * that was blocked by the CPU, the CPU itself, and the type of quiescent |
|---|
| 396 | | - * state, which can be "dti" for dyntick-idle mode, "kick" when kicking |
|---|
| 397 | | - * a CPU that has been in dyntick-idle mode for too long, or "rqc" if the |
|---|
| 398 | | - * CPU got a quiescent state via its rcu_qs_ctr. |
|---|
| 407 | + * state, which can be "dti" for dyntick-idle mode or "kick" when kicking |
|---|
| 408 | + * a CPU that has been in dyntick-idle mode for too long. |
|---|
| 399 | 409 | */ |
|---|
| 400 | | -TRACE_EVENT(rcu_fqs, |
|---|
| 410 | +TRACE_EVENT_RCU(rcu_fqs, |
|---|
| 401 | 411 | |
|---|
| 402 | 412 | TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent), |
|---|
| 403 | 413 | |
|---|
| .. | .. |
|---|
| 405 | 415 | |
|---|
| 406 | 416 | TP_STRUCT__entry( |
|---|
| 407 | 417 | __field(const char *, rcuname) |
|---|
| 408 | | - __field(unsigned long, gp_seq) |
|---|
| 418 | + __field(long, gp_seq) |
|---|
| 409 | 419 | __field(int, cpu) |
|---|
| 410 | 420 | __field(const char *, qsevent) |
|---|
| 411 | 421 | ), |
|---|
| 412 | 422 | |
|---|
| 413 | 423 | TP_fast_assign( |
|---|
| 414 | 424 | __entry->rcuname = rcuname; |
|---|
| 415 | | - __entry->gp_seq = gp_seq; |
|---|
| 425 | + __entry->gp_seq = (long)gp_seq; |
|---|
| 416 | 426 | __entry->cpu = cpu; |
|---|
| 417 | 427 | __entry->qsevent = qsevent; |
|---|
| 418 | 428 | ), |
|---|
| 419 | 429 | |
|---|
| 420 | | - TP_printk("%s %lu %d %s", |
|---|
| 430 | + TP_printk("%s %ld %d %s", |
|---|
| 421 | 431 | __entry->rcuname, __entry->gp_seq, |
|---|
| 422 | 432 | __entry->cpu, __entry->qsevent) |
|---|
| 423 | 433 | ); |
|---|
| 424 | 434 | |
|---|
| 425 | | -#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) */ |
|---|
| 435 | +/* |
|---|
| 436 | + * Tracepoint for RCU stall events. Takes a string identifying the RCU flavor |
|---|
| 437 | + * and a string identifying which function detected the RCU stall as follows: |
|---|
| 438 | + * |
|---|
| 439 | + * "StallDetected": Scheduler-tick detects other CPU's stalls. |
|---|
| 440 | + * "SelfDetected": Scheduler-tick detects a current CPU's stall. |
|---|
| 441 | + * "ExpeditedStall": Expedited grace period detects stalls. |
|---|
| 442 | + */ |
|---|
| 443 | +TRACE_EVENT(rcu_stall_warning, |
|---|
| 444 | + |
|---|
| 445 | + TP_PROTO(const char *rcuname, const char *msg), |
|---|
| 446 | + |
|---|
| 447 | + TP_ARGS(rcuname, msg), |
|---|
| 448 | + |
|---|
| 449 | + TP_STRUCT__entry( |
|---|
| 450 | + __field(const char *, rcuname) |
|---|
| 451 | + __field(const char *, msg) |
|---|
| 452 | + ), |
|---|
| 453 | + |
|---|
| 454 | + TP_fast_assign( |
|---|
| 455 | + __entry->rcuname = rcuname; |
|---|
| 456 | + __entry->msg = msg; |
|---|
| 457 | + ), |
|---|
| 458 | + |
|---|
| 459 | + TP_printk("%s %s", |
|---|
| 460 | + __entry->rcuname, __entry->msg) |
|---|
| 461 | +); |
|---|
| 462 | + |
|---|
| 463 | +#endif /* #if defined(CONFIG_TREE_RCU) */ |
|---|
| 426 | 464 | |
|---|
| 427 | 465 | /* |
|---|
| 428 | | - * Tracepoint for dyntick-idle entry/exit events. These take a string |
|---|
| 429 | | - * as argument: "Start" for entering dyntick-idle mode, "Startirq" for |
|---|
| 430 | | - * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it |
|---|
| 431 | | - * to irq/NMI, "--=" for events moving towards idle, and "++=" for events |
|---|
| 432 | | - * moving away from idle. |
|---|
| 466 | + * Tracepoint for dyntick-idle entry/exit events. These take 2 strings |
|---|
| 467 | + * as argument: |
|---|
| 468 | + * polarity: "Start", "End", "StillNonIdle" for entering, exiting or still not |
|---|
| 469 | + * being in dyntick-idle mode. |
|---|
| 470 | + * context: "USER" or "IDLE" or "IRQ". |
|---|
| 471 | + * NMIs nested in IRQs are inferred with dynticks_nesting > 1 in IRQ context. |
|---|
| 433 | 472 | * |
|---|
| 434 | 473 | * These events also take a pair of numbers, which indicate the nesting |
|---|
| 435 | 474 | * depth before and after the event of interest, and a third number that is |
|---|
| .. | .. |
|---|
| 437 | 476 | * events use two separate counters, and that the "++=" and "--=" events |
|---|
| 438 | 477 | * for irq/NMI will change the counter by two, otherwise by one. |
|---|
| 439 | 478 | */ |
|---|
| 440 | | -TRACE_EVENT(rcu_dyntick, |
|---|
| 479 | +TRACE_EVENT_RCU(rcu_dyntick, |
|---|
| 441 | 480 | |
|---|
| 442 | | - TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks), |
|---|
| 481 | + TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks), |
|---|
| 443 | 482 | |
|---|
| 444 | 483 | TP_ARGS(polarity, oldnesting, newnesting, dynticks), |
|---|
| 445 | 484 | |
|---|
| .. | .. |
|---|
| 454 | 493 | __entry->polarity = polarity; |
|---|
| 455 | 494 | __entry->oldnesting = oldnesting; |
|---|
| 456 | 495 | __entry->newnesting = newnesting; |
|---|
| 457 | | - __entry->dynticks = atomic_read(&dynticks); |
|---|
| 496 | + __entry->dynticks = dynticks; |
|---|
| 458 | 497 | ), |
|---|
| 459 | 498 | |
|---|
| 460 | 499 | TP_printk("%s %lx %lx %#3x", __entry->polarity, |
|---|
| .. | .. |
|---|
| 469 | 508 | * number of lazy callbacks queued, and the fourth element is the |
|---|
| 470 | 509 | * total number of callbacks queued. |
|---|
| 471 | 510 | */ |
|---|
| 472 | | -TRACE_EVENT(rcu_callback, |
|---|
| 511 | +TRACE_EVENT_RCU(rcu_callback, |
|---|
| 473 | 512 | |
|---|
| 474 | | - TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
|---|
| 475 | | - long qlen), |
|---|
| 513 | + TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen), |
|---|
| 476 | 514 | |
|---|
| 477 | | - TP_ARGS(rcuname, rhp, qlen_lazy, qlen), |
|---|
| 515 | + TP_ARGS(rcuname, rhp, qlen), |
|---|
| 478 | 516 | |
|---|
| 479 | 517 | TP_STRUCT__entry( |
|---|
| 480 | 518 | __field(const char *, rcuname) |
|---|
| 481 | 519 | __field(void *, rhp) |
|---|
| 482 | 520 | __field(void *, func) |
|---|
| 483 | | - __field(long, qlen_lazy) |
|---|
| 484 | 521 | __field(long, qlen) |
|---|
| 485 | 522 | ), |
|---|
| 486 | 523 | |
|---|
| .. | .. |
|---|
| 488 | 525 | __entry->rcuname = rcuname; |
|---|
| 489 | 526 | __entry->rhp = rhp; |
|---|
| 490 | 527 | __entry->func = rhp->func; |
|---|
| 491 | | - __entry->qlen_lazy = qlen_lazy; |
|---|
| 492 | 528 | __entry->qlen = qlen; |
|---|
| 493 | 529 | ), |
|---|
| 494 | 530 | |
|---|
| 495 | | - TP_printk("%s rhp=%p func=%pf %ld/%ld", |
|---|
| 531 | + TP_printk("%s rhp=%p func=%ps %ld", |
|---|
| 496 | 532 | __entry->rcuname, __entry->rhp, __entry->func, |
|---|
| 497 | | - __entry->qlen_lazy, __entry->qlen) |
|---|
| 533 | + __entry->qlen) |
|---|
| 498 | 534 | ); |
|---|
| 499 | 535 | |
|---|
| 500 | 536 | /* |
|---|
| 501 | 537 | * Tracepoint for the registration of a single RCU callback of the special |
|---|
| 502 | | - * kfree() form. The first argument is the RCU type, the second argument |
|---|
| 538 | + * kvfree() form. The first argument is the RCU type, the second argument |
|---|
| 503 | 539 | * is a pointer to the RCU callback, the third argument is the offset |
|---|
| 504 | 540 | * of the callback within the enclosing RCU-protected data structure, |
|---|
| 505 | 541 | * the fourth argument is the number of lazy callbacks queued, and the |
|---|
| 506 | 542 | * fifth argument is the total number of callbacks queued. |
|---|
| 507 | 543 | */ |
|---|
| 508 | | -TRACE_EVENT(rcu_kfree_callback, |
|---|
| 544 | +TRACE_EVENT_RCU(rcu_kvfree_callback, |
|---|
| 509 | 545 | |
|---|
| 510 | 546 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, |
|---|
| 511 | | - long qlen_lazy, long qlen), |
|---|
| 547 | + long qlen), |
|---|
| 512 | 548 | |
|---|
| 513 | | - TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), |
|---|
| 549 | + TP_ARGS(rcuname, rhp, offset, qlen), |
|---|
| 514 | 550 | |
|---|
| 515 | 551 | TP_STRUCT__entry( |
|---|
| 516 | 552 | __field(const char *, rcuname) |
|---|
| 517 | 553 | __field(void *, rhp) |
|---|
| 518 | 554 | __field(unsigned long, offset) |
|---|
| 519 | | - __field(long, qlen_lazy) |
|---|
| 520 | 555 | __field(long, qlen) |
|---|
| 521 | 556 | ), |
|---|
| 522 | 557 | |
|---|
| .. | .. |
|---|
| 524 | 559 | __entry->rcuname = rcuname; |
|---|
| 525 | 560 | __entry->rhp = rhp; |
|---|
| 526 | 561 | __entry->offset = offset; |
|---|
| 527 | | - __entry->qlen_lazy = qlen_lazy; |
|---|
| 528 | 562 | __entry->qlen = qlen; |
|---|
| 529 | 563 | ), |
|---|
| 530 | 564 | |
|---|
| 531 | | - TP_printk("%s rhp=%p func=%ld %ld/%ld", |
|---|
| 565 | + TP_printk("%s rhp=%p func=%ld %ld", |
|---|
| 532 | 566 | __entry->rcuname, __entry->rhp, __entry->offset, |
|---|
| 533 | | - __entry->qlen_lazy, __entry->qlen) |
|---|
| 567 | + __entry->qlen) |
|---|
| 534 | 568 | ); |
|---|
| 535 | 569 | |
|---|
| 536 | 570 | /* |
|---|
| .. | .. |
|---|
| 540 | 574 | * the total number of callbacks queued, and the fourth argument is |
|---|
| 541 | 575 | * the current RCU-callback batch limit. |
|---|
| 542 | 576 | */ |
|---|
| 543 | | -TRACE_EVENT(rcu_batch_start, |
|---|
| 577 | +TRACE_EVENT_RCU(rcu_batch_start, |
|---|
| 544 | 578 | |
|---|
| 545 | | - TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), |
|---|
| 579 | + TP_PROTO(const char *rcuname, long qlen, long blimit), |
|---|
| 546 | 580 | |
|---|
| 547 | | - TP_ARGS(rcuname, qlen_lazy, qlen, blimit), |
|---|
| 581 | + TP_ARGS(rcuname, qlen, blimit), |
|---|
| 548 | 582 | |
|---|
| 549 | 583 | TP_STRUCT__entry( |
|---|
| 550 | 584 | __field(const char *, rcuname) |
|---|
| 551 | | - __field(long, qlen_lazy) |
|---|
| 552 | 585 | __field(long, qlen) |
|---|
| 553 | 586 | __field(long, blimit) |
|---|
| 554 | 587 | ), |
|---|
| 555 | 588 | |
|---|
| 556 | 589 | TP_fast_assign( |
|---|
| 557 | 590 | __entry->rcuname = rcuname; |
|---|
| 558 | | - __entry->qlen_lazy = qlen_lazy; |
|---|
| 559 | 591 | __entry->qlen = qlen; |
|---|
| 560 | 592 | __entry->blimit = blimit; |
|---|
| 561 | 593 | ), |
|---|
| 562 | 594 | |
|---|
| 563 | | - TP_printk("%s CBs=%ld/%ld bl=%ld", |
|---|
| 564 | | - __entry->rcuname, __entry->qlen_lazy, __entry->qlen, |
|---|
| 565 | | - __entry->blimit) |
|---|
| 595 | + TP_printk("%s CBs=%ld bl=%ld", |
|---|
| 596 | + __entry->rcuname, __entry->qlen, __entry->blimit) |
|---|
| 566 | 597 | ); |
|---|
| 567 | 598 | |
|---|
| 568 | 599 | /* |
|---|
| .. | .. |
|---|
| 570 | 601 | * The first argument is the type of RCU, and the second argument is |
|---|
| 571 | 602 | * a pointer to the RCU callback itself. |
|---|
| 572 | 603 | */ |
|---|
| 573 | | -TRACE_EVENT(rcu_invoke_callback, |
|---|
| 604 | +TRACE_EVENT_RCU(rcu_invoke_callback, |
|---|
| 574 | 605 | |
|---|
| 575 | 606 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), |
|---|
| 576 | 607 | |
|---|
| .. | .. |
|---|
| 588 | 619 | __entry->func = rhp->func; |
|---|
| 589 | 620 | ), |
|---|
| 590 | 621 | |
|---|
| 591 | | - TP_printk("%s rhp=%p func=%pf", |
|---|
| 622 | + TP_printk("%s rhp=%p func=%ps", |
|---|
| 592 | 623 | __entry->rcuname, __entry->rhp, __entry->func) |
|---|
| 593 | 624 | ); |
|---|
| 594 | 625 | |
|---|
| 595 | 626 | /* |
|---|
| 596 | 627 | * Tracepoint for the invocation of a single RCU callback of the special |
|---|
| 597 | | - * kfree() form. The first argument is the RCU flavor, the second |
|---|
| 628 | + * kvfree() form. The first argument is the RCU flavor, the second |
|---|
| 598 | 629 | * argument is a pointer to the RCU callback, and the third argument |
|---|
| 599 | 630 | * is the offset of the callback within the enclosing RCU-protected |
|---|
| 600 | 631 | * data structure. |
|---|
| 601 | 632 | */ |
|---|
| 602 | | -TRACE_EVENT(rcu_invoke_kfree_callback, |
|---|
| 633 | +TRACE_EVENT_RCU(rcu_invoke_kvfree_callback, |
|---|
| 603 | 634 | |
|---|
| 604 | 635 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), |
|---|
| 605 | 636 | |
|---|
| .. | .. |
|---|
| 622 | 653 | ); |
|---|
| 623 | 654 | |
|---|
| 624 | 655 | /* |
|---|
| 656 | + * Tracepoint for the invocation of a single RCU callback of the special |
|---|
| 657 | + * kfree_bulk() form. The first argument is the RCU flavor, the second |
|---|
| 658 | + * argument is a number of elements in array to free, the third is an |
|---|
| 659 | + * address of the array holding nr_records entries. |
|---|
| 660 | + */ |
|---|
| 661 | +TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback, |
|---|
| 662 | + |
|---|
| 663 | + TP_PROTO(const char *rcuname, unsigned long nr_records, void **p), |
|---|
| 664 | + |
|---|
| 665 | + TP_ARGS(rcuname, nr_records, p), |
|---|
| 666 | + |
|---|
| 667 | + TP_STRUCT__entry( |
|---|
| 668 | + __field(const char *, rcuname) |
|---|
| 669 | + __field(unsigned long, nr_records) |
|---|
| 670 | + __field(void **, p) |
|---|
| 671 | + ), |
|---|
| 672 | + |
|---|
| 673 | + TP_fast_assign( |
|---|
| 674 | + __entry->rcuname = rcuname; |
|---|
| 675 | + __entry->nr_records = nr_records; |
|---|
| 676 | + __entry->p = p; |
|---|
| 677 | + ), |
|---|
| 678 | + |
|---|
| 679 | + TP_printk("%s bulk=0x%p nr_records=%lu", |
|---|
| 680 | + __entry->rcuname, __entry->p, __entry->nr_records) |
|---|
| 681 | +); |
|---|
| 682 | + |
|---|
| 683 | +/* |
|---|
| 625 | 684 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been |
|---|
| 626 | 685 | * invoked. The first argument is the name of the RCU flavor, |
|---|
| 627 | 686 | * the second argument is number of callbacks actually invoked, |
|---|
| .. | .. |
|---|
| 632 | 691 | * and the sixth argument (risk) is the return value from |
|---|
| 633 | 692 | * rcu_is_callbacks_kthread(). |
|---|
| 634 | 693 | */ |
|---|
| 635 | | -TRACE_EVENT(rcu_batch_end, |
|---|
| 694 | +TRACE_EVENT_RCU(rcu_batch_end, |
|---|
| 636 | 695 | |
|---|
| 637 | 696 | TP_PROTO(const char *rcuname, int callbacks_invoked, |
|---|
| 638 | 697 | char cb, char nr, char iit, char risk), |
|---|
| .. | .. |
|---|
| 674 | 733 | * callback address can be NULL. |
|---|
| 675 | 734 | */ |
|---|
| 676 | 735 | #define RCUTORTURENAME_LEN 8 |
|---|
| 677 | | -TRACE_EVENT(rcu_torture_read, |
|---|
| 736 | +TRACE_EVENT_RCU(rcu_torture_read, |
|---|
| 678 | 737 | |
|---|
| 679 | 738 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, |
|---|
| 680 | 739 | unsigned long secs, unsigned long c_old, unsigned long c), |
|---|
| .. | .. |
|---|
| 682 | 741 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), |
|---|
| 683 | 742 | |
|---|
| 684 | 743 | TP_STRUCT__entry( |
|---|
| 685 | | - __field(char, rcutorturename[RCUTORTURENAME_LEN]) |
|---|
| 744 | + __array(char, rcutorturename, RCUTORTURENAME_LEN) |
|---|
| 686 | 745 | __field(struct rcu_head *, rhp) |
|---|
| 687 | 746 | __field(unsigned long, secs) |
|---|
| 688 | 747 | __field(unsigned long, c_old) |
|---|
| .. | .. |
|---|
| 705 | 764 | ); |
|---|
| 706 | 765 | |
|---|
| 707 | 766 | /* |
|---|
| 708 | | - * Tracepoint for _rcu_barrier() execution. The string "s" describes |
|---|
| 709 | | - * the _rcu_barrier phase: |
|---|
| 710 | | - * "Begin": _rcu_barrier() started. |
|---|
| 711 | | - * "EarlyExit": _rcu_barrier() piggybacked, thus early exit. |
|---|
| 712 | | - * "Inc1": _rcu_barrier() piggyback check counter incremented. |
|---|
| 713 | | - * "OfflineNoCB": _rcu_barrier() found callback on never-online CPU |
|---|
| 714 | | - * "OnlineNoCB": _rcu_barrier() found online no-CBs CPU. |
|---|
| 715 | | - * "OnlineQ": _rcu_barrier() found online CPU with callbacks. |
|---|
| 716 | | - * "OnlineNQ": _rcu_barrier() found online CPU, no callbacks. |
|---|
| 767 | + * Tracepoint for rcu_barrier() execution. The string "s" describes |
|---|
| 768 | + * the rcu_barrier phase: |
|---|
| 769 | + * "Begin": rcu_barrier() started. |
|---|
| 770 | + * "EarlyExit": rcu_barrier() piggybacked, thus early exit. |
|---|
| 771 | + * "Inc1": rcu_barrier() piggyback check counter incremented. |
|---|
| 772 | + * "OfflineNoCBQ": rcu_barrier() found offline no-CBs CPU with callbacks. |
|---|
| 773 | + * "OnlineQ": rcu_barrier() found online CPU with callbacks. |
|---|
| 774 | + * "OnlineNQ": rcu_barrier() found online CPU, no callbacks. |
|---|
| 717 | 775 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. |
|---|
| 718 | 776 | * "IRQNQ": An rcu_barrier_callback() callback found no callbacks. |
|---|
| 719 | 777 | * "CB": An rcu_barrier_callback() invoked a callback, not the last. |
|---|
| 720 | 778 | * "LastCB": An rcu_barrier_callback() invoked the last callback. |
|---|
| 721 | | - * "Inc2": _rcu_barrier() piggyback check counter incremented. |
|---|
| 779 | + * "Inc2": rcu_barrier() piggyback check counter incremented. |
|---|
| 722 | 780 | * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument |
|---|
| 723 | 781 | * is the count of remaining callbacks, and "done" is the piggybacking count. |
|---|
| 724 | 782 | */ |
|---|
| 725 | | -TRACE_EVENT(rcu_barrier, |
|---|
| 783 | +TRACE_EVENT_RCU(rcu_barrier, |
|---|
| 726 | 784 | |
|---|
| 727 | 785 | TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), |
|---|
| 728 | 786 | |
|---|
| .. | .. |
|---|
| 748 | 806 | __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt, |
|---|
| 749 | 807 | __entry->done) |
|---|
| 750 | 808 | ); |
|---|
| 751 | | - |
|---|
| 752 | | -#else /* #ifdef CONFIG_RCU_TRACE */ |
|---|
| 753 | | - |
|---|
| 754 | | -#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0) |
|---|
| 755 | | -#define trace_rcu_future_grace_period(rcuname, gp_seq, gp_seq_req, \ |
|---|
| 756 | | - level, grplo, grphi, event) \ |
|---|
| 757 | | - do { } while (0) |
|---|
| 758 | | -#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \ |
|---|
| 759 | | - qsmask) do { } while (0) |
|---|
| 760 | | -#define trace_rcu_exp_grace_period(rcuname, gqseq, gpevent) \ |
|---|
| 761 | | - do { } while (0) |
|---|
| 762 | | -#define trace_rcu_exp_funnel_lock(rcuname, level, grplo, grphi, gpevent) \ |
|---|
| 763 | | - do { } while (0) |
|---|
| 764 | | -#define trace_rcu_nocb_wake(rcuname, cpu, reason) do { } while (0) |
|---|
| 765 | | -#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0) |
|---|
| 766 | | -#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0) |
|---|
| 767 | | -#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \ |
|---|
| 768 | | - grplo, grphi, gp_tasks) do { } \ |
|---|
| 769 | | - while (0) |
|---|
| 770 | | -#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0) |
|---|
| 771 | | -#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0) |
|---|
| 772 | | -#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) |
|---|
| 773 | | -#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ |
|---|
| 774 | | - do { } while (0) |
|---|
| 775 | | -#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ |
|---|
| 776 | | - do { } while (0) |
|---|
| 777 | | -#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) |
|---|
| 778 | | -#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) |
|---|
| 779 | | -#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ |
|---|
| 780 | | - do { } while (0) |
|---|
| 781 | | -#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
|---|
| 782 | | - do { } while (0) |
|---|
| 783 | | -#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) |
|---|
| 784 | | - |
|---|
| 785 | | -#endif /* #else #ifdef CONFIG_RCU_TRACE */ |
|---|
| 786 | 809 | |
|---|
| 787 | 810 | #endif /* _TRACE_RCU_H */ |
|---|
| 788 | 811 | |
|---|