Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM rcu |
| 3 | |
| 4 | #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_RCU_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
| 9 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 10 | * Tracepoint for start/end markers used for utilization calculations. |
| 11 | * By convention, the string is of the following forms: |
| 12 | * |
| 13 | * "Start <activity>" -- Mark the start of the specified activity, |
| 14 | * such as "context switch". Nesting is permitted. |
| 15 | * "End <activity>" -- Mark the end of the specified activity. |
Paul E. McKenney | 385680a | 2011-06-21 22:43:26 -0700 | [diff] [blame] | 16 | * |
| 17 | * An "@" character within "<activity>" is a comment character: Data |
| 18 | * reduction scripts will ignore the "@" and the remainder of the line. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 19 | */ |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 20 | TRACE_EVENT(rcu_utilization, |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 21 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 22 | TP_PROTO(char *s), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 23 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 24 | TP_ARGS(s), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 25 | |
| 26 | TP_STRUCT__entry( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 27 | __field(char *, s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 28 | ), |
| 29 | |
| 30 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 31 | __entry->s = s; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 32 | ), |
| 33 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 34 | TP_printk("%s", __entry->s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 35 | ); |
| 36 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 37 | #ifdef CONFIG_RCU_TRACE |
| 38 | |
| 39 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 40 | |
| 41 | /* |
| 42 | * Tracepoint for grace-period events: starting and ending a grace |
| 43 | * period ("start" and "end", respectively), a CPU noting the start |
| 44 | * of a new grace period or the end of an old grace period ("cpustart" |
| 45 | * and "cpuend", respectively), a CPU passing through a quiescent |
| 46 | * state ("cpuqs"), a CPU coming online or going offline ("cpuonl" |
Paul E. McKenney | 6d4b418 | 2012-11-27 16:55:44 -0800 | [diff] [blame^] | 47 | * and "cpuofl", respectively), a CPU being kicked for being too |
| 48 | * long in dyntick-idle mode ("kick"), a CPU accelerating its new |
| 49 | * callbacks to RCU_NEXT_READY_TAIL ("AccReadyCB"), and a CPU |
| 50 | * accelerating its new callbacks to RCU_WAIT_TAIL ("AccWaitCB"). |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 51 | */ |
| 52 | TRACE_EVENT(rcu_grace_period, |
| 53 | |
| 54 | TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), |
| 55 | |
| 56 | TP_ARGS(rcuname, gpnum, gpevent), |
| 57 | |
| 58 | TP_STRUCT__entry( |
| 59 | __field(char *, rcuname) |
| 60 | __field(unsigned long, gpnum) |
| 61 | __field(char *, gpevent) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | __entry->rcuname = rcuname; |
| 66 | __entry->gpnum = gpnum; |
| 67 | __entry->gpevent = gpevent; |
| 68 | ), |
| 69 | |
| 70 | TP_printk("%s %lu %s", |
| 71 | __entry->rcuname, __entry->gpnum, __entry->gpevent) |
| 72 | ); |
| 73 | |
| 74 | /* |
| 75 | * Tracepoint for grace-period-initialization events. These are |
| 76 | * distinguished by the type of RCU, the new grace-period number, the |
| 77 | * rcu_node structure level, the starting and ending CPU covered by the |
| 78 | * rcu_node structure, and the mask of CPUs that will be waited for. |
| 79 | * All but the type of RCU are extracted from the rcu_node structure. |
| 80 | */ |
| 81 | TRACE_EVENT(rcu_grace_period_init, |
| 82 | |
| 83 | TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, |
| 84 | int grplo, int grphi, unsigned long qsmask), |
| 85 | |
| 86 | TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), |
| 87 | |
| 88 | TP_STRUCT__entry( |
| 89 | __field(char *, rcuname) |
| 90 | __field(unsigned long, gpnum) |
| 91 | __field(u8, level) |
| 92 | __field(int, grplo) |
| 93 | __field(int, grphi) |
| 94 | __field(unsigned long, qsmask) |
| 95 | ), |
| 96 | |
| 97 | TP_fast_assign( |
| 98 | __entry->rcuname = rcuname; |
| 99 | __entry->gpnum = gpnum; |
| 100 | __entry->level = level; |
| 101 | __entry->grplo = grplo; |
| 102 | __entry->grphi = grphi; |
| 103 | __entry->qsmask = qsmask; |
| 104 | ), |
| 105 | |
| 106 | TP_printk("%s %lu %u %d %d %lx", |
| 107 | __entry->rcuname, __entry->gpnum, __entry->level, |
| 108 | __entry->grplo, __entry->grphi, __entry->qsmask) |
| 109 | ); |
| 110 | |
| 111 | /* |
| 112 | * Tracepoint for tasks blocking within preemptible-RCU read-side |
| 113 | * critical sections. Track the type of RCU (which one day might |
| 114 | * include SRCU), the grace-period number that the task is blocking |
| 115 | * (the current or the next), and the task's PID. |
| 116 | */ |
| 117 | TRACE_EVENT(rcu_preempt_task, |
| 118 | |
| 119 | TP_PROTO(char *rcuname, int pid, unsigned long gpnum), |
| 120 | |
| 121 | TP_ARGS(rcuname, pid, gpnum), |
| 122 | |
| 123 | TP_STRUCT__entry( |
| 124 | __field(char *, rcuname) |
| 125 | __field(unsigned long, gpnum) |
| 126 | __field(int, pid) |
| 127 | ), |
| 128 | |
| 129 | TP_fast_assign( |
| 130 | __entry->rcuname = rcuname; |
| 131 | __entry->gpnum = gpnum; |
| 132 | __entry->pid = pid; |
| 133 | ), |
| 134 | |
| 135 | TP_printk("%s %lu %d", |
| 136 | __entry->rcuname, __entry->gpnum, __entry->pid) |
| 137 | ); |
| 138 | |
| 139 | /* |
| 140 | * Tracepoint for tasks that blocked within a given preemptible-RCU |
| 141 | * read-side critical section exiting that critical section. Track the |
| 142 | * type of RCU (which one day might include SRCU) and the task's PID. |
| 143 | */ |
| 144 | TRACE_EVENT(rcu_unlock_preempted_task, |
| 145 | |
| 146 | TP_PROTO(char *rcuname, unsigned long gpnum, int pid), |
| 147 | |
| 148 | TP_ARGS(rcuname, gpnum, pid), |
| 149 | |
| 150 | TP_STRUCT__entry( |
| 151 | __field(char *, rcuname) |
| 152 | __field(unsigned long, gpnum) |
| 153 | __field(int, pid) |
| 154 | ), |
| 155 | |
| 156 | TP_fast_assign( |
| 157 | __entry->rcuname = rcuname; |
| 158 | __entry->gpnum = gpnum; |
| 159 | __entry->pid = pid; |
| 160 | ), |
| 161 | |
| 162 | TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid) |
| 163 | ); |
| 164 | |
| 165 | /* |
| 166 | * Tracepoint for quiescent-state-reporting events. These are |
| 167 | * distinguished by the type of RCU, the grace-period number, the |
| 168 | * mask of quiescent lower-level entities, the rcu_node structure level, |
| 169 | * the starting and ending CPU covered by the rcu_node structure, and |
| 170 | * whether there are any blocked tasks blocking the current grace period. |
| 171 | * All but the type of RCU are extracted from the rcu_node structure. |
| 172 | */ |
| 173 | TRACE_EVENT(rcu_quiescent_state_report, |
| 174 | |
| 175 | TP_PROTO(char *rcuname, unsigned long gpnum, |
| 176 | unsigned long mask, unsigned long qsmask, |
| 177 | u8 level, int grplo, int grphi, int gp_tasks), |
| 178 | |
| 179 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), |
| 180 | |
| 181 | TP_STRUCT__entry( |
| 182 | __field(char *, rcuname) |
| 183 | __field(unsigned long, gpnum) |
| 184 | __field(unsigned long, mask) |
| 185 | __field(unsigned long, qsmask) |
| 186 | __field(u8, level) |
| 187 | __field(int, grplo) |
| 188 | __field(int, grphi) |
| 189 | __field(u8, gp_tasks) |
| 190 | ), |
| 191 | |
| 192 | TP_fast_assign( |
| 193 | __entry->rcuname = rcuname; |
| 194 | __entry->gpnum = gpnum; |
| 195 | __entry->mask = mask; |
| 196 | __entry->qsmask = qsmask; |
| 197 | __entry->level = level; |
| 198 | __entry->grplo = grplo; |
| 199 | __entry->grphi = grphi; |
| 200 | __entry->gp_tasks = gp_tasks; |
| 201 | ), |
| 202 | |
| 203 | TP_printk("%s %lu %lx>%lx %u %d %d %u", |
| 204 | __entry->rcuname, __entry->gpnum, |
| 205 | __entry->mask, __entry->qsmask, __entry->level, |
| 206 | __entry->grplo, __entry->grphi, __entry->gp_tasks) |
| 207 | ); |
| 208 | |
| 209 | /* |
| 210 | * Tracepoint for quiescent states detected by force_quiescent_state(). |
| 211 | * These trace events include the type of RCU, the grace-period number |
| 212 | * that was blocked by the CPU, the CPU itself, and the type of quiescent |
| 213 | * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, |
| 214 | * or "kick" when kicking a CPU that has been in dyntick-idle mode for |
| 215 | * too long. |
| 216 | */ |
| 217 | TRACE_EVENT(rcu_fqs, |
| 218 | |
| 219 | TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), |
| 220 | |
| 221 | TP_ARGS(rcuname, gpnum, cpu, qsevent), |
| 222 | |
| 223 | TP_STRUCT__entry( |
| 224 | __field(char *, rcuname) |
| 225 | __field(unsigned long, gpnum) |
| 226 | __field(int, cpu) |
| 227 | __field(char *, qsevent) |
| 228 | ), |
| 229 | |
| 230 | TP_fast_assign( |
| 231 | __entry->rcuname = rcuname; |
| 232 | __entry->gpnum = gpnum; |
| 233 | __entry->cpu = cpu; |
| 234 | __entry->qsevent = qsevent; |
| 235 | ), |
| 236 | |
| 237 | TP_printk("%s %lu %d %s", |
| 238 | __entry->rcuname, __entry->gpnum, |
| 239 | __entry->cpu, __entry->qsevent) |
| 240 | ); |
| 241 | |
| 242 | #endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */ |
| 243 | |
| 244 | /* |
| 245 | * Tracepoint for dyntick-idle entry/exit events. These take a string |
Paul E. McKenney | 045fb93 | 2011-11-22 12:13:03 -0800 | [diff] [blame] | 246 | * as argument: "Start" for entering dyntick-idle mode, "End" for |
| 247 | * leaving it, "--=" for events moving towards idle, and "++=" for events |
| 248 | * moving away from idle. "Error on entry: not idle task" and "Error on |
| 249 | * exit: not idle task" indicate that a non-idle task is erroneously |
| 250 | * toying with the idle loop. |
| 251 | * |
| 252 | * These events also take a pair of numbers, which indicate the nesting |
| 253 | * depth before and after the event of interest. Note that task-related |
| 254 | * events use the upper bits of each number, while interrupt-related |
| 255 | * events use the lower bits. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 256 | */ |
| 257 | TRACE_EVENT(rcu_dyntick, |
| 258 | |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 259 | TP_PROTO(char *polarity, long long oldnesting, long long newnesting), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 260 | |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 261 | TP_ARGS(polarity, oldnesting, newnesting), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 262 | |
| 263 | TP_STRUCT__entry( |
| 264 | __field(char *, polarity) |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 265 | __field(long long, oldnesting) |
| 266 | __field(long long, newnesting) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 267 | ), |
| 268 | |
| 269 | TP_fast_assign( |
| 270 | __entry->polarity = polarity; |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 271 | __entry->oldnesting = oldnesting; |
| 272 | __entry->newnesting = newnesting; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 273 | ), |
| 274 | |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 275 | TP_printk("%s %llx %llx", __entry->polarity, |
| 276 | __entry->oldnesting, __entry->newnesting) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 277 | ); |
| 278 | |
| 279 | /* |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 280 | * Tracepoint for RCU preparation for idle, the goal being to get RCU |
| 281 | * processing done so that the current CPU can shut off its scheduling |
| 282 | * clock and enter dyntick-idle mode. One way to accomplish this is |
| 283 | * to drain all RCU callbacks from this CPU, and the other is to have |
| 284 | * done everything RCU requires for the current grace period. In this |
| 285 | * latter case, the CPU will be awakened at the end of the current grace |
| 286 | * period in order to process the remainder of its callbacks. |
| 287 | * |
| 288 | * These tracepoints take a string as argument: |
| 289 | * |
| 290 | * "No callbacks": Nothing to do, no callbacks on this CPU. |
| 291 | * "In holdoff": Nothing to do, holding off after unsuccessful attempt. |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 292 | * "Begin holdoff": Attempt failed, don't retry until next jiffy. |
Paul E. McKenney | 7cb9249 | 2011-11-28 12:28:34 -0800 | [diff] [blame] | 293 | * "Dyntick with callbacks": Entering dyntick-idle despite callbacks. |
Paul E. McKenney | fd4b352 | 2012-05-05 19:10:35 -0700 | [diff] [blame] | 294 | * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks. |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 295 | * "More callbacks": Still more callbacks, try again to clear them out. |
| 296 | * "Callbacks drained": All callbacks processed, off to dyntick idle! |
Paul E. McKenney | 7cb9249 | 2011-11-28 12:28:34 -0800 | [diff] [blame] | 297 | * "Timer": Timer fired to cause CPU to continue processing callbacks. |
Paul E. McKenney | 21e52e1 | 2012-04-30 14:16:19 -0700 | [diff] [blame] | 298 | * "Demigrate": Timer fired on wrong CPU, woke up correct CPU. |
Paul E. McKenney | 2fdbb31 | 2012-02-23 15:58:29 -0800 | [diff] [blame] | 299 | * "Cleanup after idle": Idle exited, timer canceled. |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 300 | */ |
| 301 | TRACE_EVENT(rcu_prep_idle, |
| 302 | |
| 303 | TP_PROTO(char *reason), |
| 304 | |
| 305 | TP_ARGS(reason), |
| 306 | |
| 307 | TP_STRUCT__entry( |
| 308 | __field(char *, reason) |
| 309 | ), |
| 310 | |
| 311 | TP_fast_assign( |
| 312 | __entry->reason = reason; |
| 313 | ), |
| 314 | |
| 315 | TP_printk("%s", __entry->reason) |
| 316 | ); |
| 317 | |
| 318 | /* |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 319 | * Tracepoint for the registration of a single RCU callback function. |
| 320 | * The first argument is the type of RCU, the second argument is |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 321 | * a pointer to the RCU callback itself, the third element is the |
| 322 | * number of lazy callbacks queued, and the fourth element is the |
| 323 | * total number of callbacks queued. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 324 | */ |
| 325 | TRACE_EVENT(rcu_callback, |
| 326 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 327 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
| 328 | long qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 329 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 330 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 331 | |
| 332 | TP_STRUCT__entry( |
| 333 | __field(char *, rcuname) |
| 334 | __field(void *, rhp) |
| 335 | __field(void *, func) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 336 | __field(long, qlen_lazy) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 337 | __field(long, qlen) |
| 338 | ), |
| 339 | |
| 340 | TP_fast_assign( |
| 341 | __entry->rcuname = rcuname; |
| 342 | __entry->rhp = rhp; |
| 343 | __entry->func = rhp->func; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 344 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 345 | __entry->qlen = qlen; |
| 346 | ), |
| 347 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 348 | TP_printk("%s rhp=%p func=%pf %ld/%ld", |
| 349 | __entry->rcuname, __entry->rhp, __entry->func, |
| 350 | __entry->qlen_lazy, __entry->qlen) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 351 | ); |
| 352 | |
| 353 | /* |
| 354 | * Tracepoint for the registration of a single RCU callback of the special |
| 355 | * kfree() form. The first argument is the RCU type, the second argument |
| 356 | * is a pointer to the RCU callback, the third argument is the offset |
| 357 | * of the callback within the enclosing RCU-protected data structure, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 358 | * the fourth argument is the number of lazy callbacks queued, and the |
| 359 | * fifth argument is the total number of callbacks queued. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 360 | */ |
| 361 | TRACE_EVENT(rcu_kfree_callback, |
| 362 | |
| 363 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 364 | long qlen_lazy, long qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 365 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 366 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 367 | |
| 368 | TP_STRUCT__entry( |
| 369 | __field(char *, rcuname) |
| 370 | __field(void *, rhp) |
| 371 | __field(unsigned long, offset) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 372 | __field(long, qlen_lazy) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 373 | __field(long, qlen) |
| 374 | ), |
| 375 | |
| 376 | TP_fast_assign( |
| 377 | __entry->rcuname = rcuname; |
| 378 | __entry->rhp = rhp; |
| 379 | __entry->offset = offset; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 380 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 381 | __entry->qlen = qlen; |
| 382 | ), |
| 383 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 384 | TP_printk("%s rhp=%p func=%ld %ld/%ld", |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 385 | __entry->rcuname, __entry->rhp, __entry->offset, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 386 | __entry->qlen_lazy, __entry->qlen) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 387 | ); |
| 388 | |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 389 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 390 | * Tracepoint for marking the beginning rcu_do_batch, performed to start |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 391 | * RCU callback invocation. The first argument is the RCU flavor, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 392 | * the second is the number of lazy callbacks queued, the third is |
| 393 | * the total number of callbacks queued, and the fourth argument is |
| 394 | * the current RCU-callback batch limit. |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 395 | */ |
| 396 | TRACE_EVENT(rcu_batch_start, |
| 397 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 398 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 399 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 400 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 401 | |
| 402 | TP_STRUCT__entry( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 403 | __field(char *, rcuname) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 404 | __field(long, qlen_lazy) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 405 | __field(long, qlen) |
| 406 | __field(int, blimit) |
| 407 | ), |
| 408 | |
| 409 | TP_fast_assign( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 410 | __entry->rcuname = rcuname; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 411 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 412 | __entry->qlen = qlen; |
| 413 | __entry->blimit = blimit; |
| 414 | ), |
| 415 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 416 | TP_printk("%s CBs=%ld/%ld bl=%d", |
| 417 | __entry->rcuname, __entry->qlen_lazy, __entry->qlen, |
| 418 | __entry->blimit) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 419 | ); |
| 420 | |
| 421 | /* |
| 422 | * Tracepoint for the invocation of a single RCU callback function. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 423 | * The first argument is the type of RCU, and the second argument is |
| 424 | * a pointer to the RCU callback itself. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 425 | */ |
| 426 | TRACE_EVENT(rcu_invoke_callback, |
| 427 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 428 | TP_PROTO(char *rcuname, struct rcu_head *rhp), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 429 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 430 | TP_ARGS(rcuname, rhp), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 431 | |
| 432 | TP_STRUCT__entry( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 433 | __field(char *, rcuname) |
| 434 | __field(void *, rhp) |
| 435 | __field(void *, func) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 436 | ), |
| 437 | |
| 438 | TP_fast_assign( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 439 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 440 | __entry->rhp = rhp; |
| 441 | __entry->func = rhp->func; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 442 | ), |
| 443 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 444 | TP_printk("%s rhp=%p func=%pf", |
| 445 | __entry->rcuname, __entry->rhp, __entry->func) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 446 | ); |
| 447 | |
| 448 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 449 | * Tracepoint for the invocation of a single RCU callback of the special |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 450 | * kfree() form. The first argument is the RCU flavor, the second |
| 451 | * argument is a pointer to the RCU callback, and the third argument |
| 452 | * is the offset of the callback within the enclosing RCU-protected |
| 453 | * data structure. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 454 | */ |
| 455 | TRACE_EVENT(rcu_invoke_kfree_callback, |
| 456 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 457 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 458 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 459 | TP_ARGS(rcuname, rhp, offset), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 460 | |
| 461 | TP_STRUCT__entry( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 462 | __field(char *, rcuname) |
| 463 | __field(void *, rhp) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 464 | __field(unsigned long, offset) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 465 | ), |
| 466 | |
| 467 | TP_fast_assign( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 468 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 469 | __entry->rhp = rhp; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 470 | __entry->offset = offset; |
| 471 | ), |
| 472 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 473 | TP_printk("%s rhp=%p func=%ld", |
| 474 | __entry->rcuname, __entry->rhp, __entry->offset) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 475 | ); |
| 476 | |
| 477 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 478 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 479 | * invoked. The first argument is the name of the RCU flavor, |
| 480 | * the second argument is number of callbacks actually invoked, |
| 481 | * the third argument (cb) is whether or not any of the callbacks that |
| 482 | * were ready to invoke at the beginning of this batch are still |
| 483 | * queued, the fourth argument (nr) is the return value of need_resched(), |
| 484 | * the fifth argument (iit) is 1 if the current task is the idle task, |
| 485 | * and the sixth argument (risk) is the return value from |
| 486 | * rcu_is_callbacks_kthread(). |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 487 | */ |
| 488 | TRACE_EVENT(rcu_batch_end, |
| 489 | |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 490 | TP_PROTO(char *rcuname, int callbacks_invoked, |
| 491 | bool cb, bool nr, bool iit, bool risk), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 492 | |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 493 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 494 | |
| 495 | TP_STRUCT__entry( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 496 | __field(char *, rcuname) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 497 | __field(int, callbacks_invoked) |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 498 | __field(bool, cb) |
| 499 | __field(bool, nr) |
| 500 | __field(bool, iit) |
| 501 | __field(bool, risk) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 502 | ), |
| 503 | |
| 504 | TP_fast_assign( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 505 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 506 | __entry->callbacks_invoked = callbacks_invoked; |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 507 | __entry->cb = cb; |
| 508 | __entry->nr = nr; |
| 509 | __entry->iit = iit; |
| 510 | __entry->risk = risk; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 511 | ), |
| 512 | |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 513 | TP_printk("%s CBs-invoked=%d idle=%c%c%c%c", |
| 514 | __entry->rcuname, __entry->callbacks_invoked, |
| 515 | __entry->cb ? 'C' : '.', |
| 516 | __entry->nr ? 'S' : '.', |
| 517 | __entry->iit ? 'I' : '.', |
| 518 | __entry->risk ? 'R' : '.') |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 519 | ); |
| 520 | |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 521 | /* |
| 522 | * Tracepoint for rcutorture readers. The first argument is the name |
| 523 | * of the RCU flavor from rcutorture's viewpoint and the second argument |
| 524 | * is the callback address. |
| 525 | */ |
| 526 | TRACE_EVENT(rcu_torture_read, |
| 527 | |
| 528 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp), |
| 529 | |
| 530 | TP_ARGS(rcutorturename, rhp), |
| 531 | |
| 532 | TP_STRUCT__entry( |
| 533 | __field(char *, rcutorturename) |
| 534 | __field(struct rcu_head *, rhp) |
| 535 | ), |
| 536 | |
| 537 | TP_fast_assign( |
| 538 | __entry->rcutorturename = rcutorturename; |
| 539 | __entry->rhp = rhp; |
| 540 | ), |
| 541 | |
| 542 | TP_printk("%s torture read %p", |
| 543 | __entry->rcutorturename, __entry->rhp) |
| 544 | ); |
| 545 | |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 546 | /* |
| 547 | * Tracepoint for _rcu_barrier() execution. The string "s" describes |
| 548 | * the _rcu_barrier phase: |
| 549 | * "Begin": rcu_barrier_callback() started. |
| 550 | * "Check": rcu_barrier_callback() checking for piggybacking. |
| 551 | * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. |
| 552 | * "Inc1": rcu_barrier_callback() piggyback check counter incremented. |
| 553 | * "Offline": rcu_barrier_callback() found offline CPU |
Paul E. McKenney | 3fbfbf7 | 2012-08-19 21:35:53 -0700 | [diff] [blame] | 554 | * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU. |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 555 | * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. |
| 556 | * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. |
| 557 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. |
| 558 | * "CB": An rcu_barrier_callback() invoked a callback, not the last. |
| 559 | * "LastCB": An rcu_barrier_callback() invoked the last callback. |
| 560 | * "Inc2": rcu_barrier_callback() piggyback check counter incremented. |
| 561 | * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument |
| 562 | * is the count of remaining callbacks, and "done" is the piggybacking count. |
| 563 | */ |
| 564 | TRACE_EVENT(rcu_barrier, |
| 565 | |
| 566 | TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), |
| 567 | |
| 568 | TP_ARGS(rcuname, s, cpu, cnt, done), |
| 569 | |
| 570 | TP_STRUCT__entry( |
| 571 | __field(char *, rcuname) |
| 572 | __field(char *, s) |
| 573 | __field(int, cpu) |
| 574 | __field(int, cnt) |
| 575 | __field(unsigned long, done) |
| 576 | ), |
| 577 | |
| 578 | TP_fast_assign( |
| 579 | __entry->rcuname = rcuname; |
| 580 | __entry->s = s; |
| 581 | __entry->cpu = cpu; |
| 582 | __entry->cnt = cnt; |
| 583 | __entry->done = done; |
| 584 | ), |
| 585 | |
| 586 | TP_printk("%s %s cpu %d remaining %d # %lu", |
| 587 | __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt, |
| 588 | __entry->done) |
| 589 | ); |
| 590 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 591 | #else /* #ifdef CONFIG_RCU_TRACE */ |
| 592 | |
| 593 | #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 594 | #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ |
| 595 | qsmask) do { } while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 596 | #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) |
| 597 | #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 598 | #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ |
| 599 | grplo, grphi, gp_tasks) do { } \ |
| 600 | while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 601 | #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 602 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 603 | #define trace_rcu_prep_idle(reason) do { } while (0) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 604 | #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) |
| 605 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ |
| 606 | do { } while (0) |
| 607 | #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ |
| 608 | do { } while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 609 | #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) |
| 610 | #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 611 | #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ |
| 612 | do { } while (0) |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 613 | #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 614 | #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 615 | |
| 616 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ |
| 617 | |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 618 | #endif /* _TRACE_RCU_H */ |
| 619 | |
| 620 | /* This part must be outside protection */ |
| 621 | #include <trace/define_trace.h> |