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