Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM rcu |
| 4 | |
| 5 | #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_RCU_H |
| 7 | |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
| 10 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 11 | * Tracepoint for start/end markers used for utilization calculations. |
| 12 | * By convention, the string is of the following forms: |
| 13 | * |
| 14 | * "Start <activity>" -- Mark the start of the specified activity, |
| 15 | * such as "context switch". Nesting is permitted. |
| 16 | * "End <activity>" -- Mark the end of the specified activity. |
Paul E. McKenney | 385680a | 2011-06-21 22:43:26 -0700 | [diff] [blame] | 17 | * |
| 18 | * An "@" character within "<activity>" is a comment character: Data |
| 19 | * reduction scripts will ignore the "@" and the remainder of the line. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 20 | */ |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 21 | TRACE_EVENT(rcu_utilization, |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 22 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 23 | TP_PROTO(const char *s), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 24 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 25 | TP_ARGS(s), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 26 | |
| 27 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 28 | __field(const char *, s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 29 | ), |
| 30 | |
| 31 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 32 | __entry->s = s; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 33 | ), |
| 34 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 35 | TP_printk("%s", __entry->s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 36 | ); |
| 37 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 38 | #ifdef CONFIG_RCU_TRACE |
| 39 | |
Pranith Kumar | 28f6569 | 2014-09-22 14:00:48 -0400 | [diff] [blame] | 40 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 41 | |
| 42 | /* |
Paul E. McKenney | 63c4db7 | 2013-08-09 12:19:29 -0700 | [diff] [blame] | 43 | * Tracepoint for grace-period events. Takes a string identifying the |
| 44 | * RCU flavor, the grace-period number, and a string identifying the |
| 45 | * grace-period-related event as follows: |
| 46 | * |
| 47 | * "AccReadyCB": CPU acclerates new callbacks to RCU_NEXT_READY_TAIL. |
| 48 | * "AccWaitCB": CPU accelerates new callbacks to RCU_WAIT_TAIL. |
Paul E. McKenney | bb311ec | 2013-08-09 16:02:09 -0700 | [diff] [blame] | 49 | * "newreq": Request a new grace period. |
Paul E. McKenney | 63c4db7 | 2013-08-09 12:19:29 -0700 | [diff] [blame] | 50 | * "start": Start a grace period. |
| 51 | * "cpustart": CPU first notices a grace-period start. |
| 52 | * "cpuqs": CPU passes through a quiescent state. |
| 53 | * "cpuonl": CPU comes online. |
| 54 | * "cpuofl": CPU goes offline. |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 55 | * "cpuofl-bgp": CPU goes offline while blocking a grace period. |
Paul E. McKenney | 63c4db7 | 2013-08-09 12:19:29 -0700 | [diff] [blame] | 56 | * "reqwait": GP kthread sleeps waiting for grace-period request. |
| 57 | * "reqwaitsig": GP kthread awakened by signal from reqwait state. |
| 58 | * "fqswait": GP kthread waiting until time to force quiescent states. |
| 59 | * "fqsstart": GP kthread starts forcing quiescent states. |
| 60 | * "fqsend": GP kthread done forcing quiescent states. |
| 61 | * "fqswaitsig": GP kthread awakened by signal from fqswait state. |
| 62 | * "end": End a grace period. |
| 63 | * "cpuend": CPU first notices a grace-period end. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 64 | */ |
| 65 | TRACE_EVENT(rcu_grace_period, |
| 66 | |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 67 | TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 68 | |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 69 | TP_ARGS(rcuname, gp_seq, gpevent), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 70 | |
| 71 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 72 | __field(const char *, rcuname) |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 73 | __field(unsigned long, gp_seq) |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 74 | __field(const char *, gpevent) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 75 | ), |
| 76 | |
| 77 | TP_fast_assign( |
| 78 | __entry->rcuname = rcuname; |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 79 | __entry->gp_seq = gp_seq; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 80 | __entry->gpevent = gpevent; |
| 81 | ), |
| 82 | |
| 83 | TP_printk("%s %lu %s", |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 84 | __entry->rcuname, __entry->gp_seq, __entry->gpevent) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 85 | ); |
| 86 | |
| 87 | /* |
Paul E. McKenney | c21b8b3 | 2018-04-19 16:38:25 -0700 | [diff] [blame] | 88 | * Tracepoint for future grace-period events. The caller should pull |
| 89 | * the data from the rcu_node structure, other than rcuname, which comes |
| 90 | * from the rcu_state structure, and event, which is one of the following: |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 91 | * |
Paul E. McKenney | c21b8b3 | 2018-04-19 16:38:25 -0700 | [diff] [blame] | 92 | * "Startleaf": Request a grace period based on leaf-node data. |
| 93 | * "Prestarted": Someone beat us to the request |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 94 | * "Startedleaf": Leaf-node start proved sufficient. |
| 95 | * "Startedleafroot": Leaf-node start proved sufficient after checking root. |
| 96 | * "Startedroot": Requested a nocb grace period based on root-node data. |
Paul E. McKenney | c21b8b3 | 2018-04-19 16:38:25 -0700 | [diff] [blame] | 97 | * "NoGPkthread": The RCU grace-period kthread has not yet started. |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 98 | * "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. |
Paul E. McKenney | c21b8b3 | 2018-04-19 16:38:25 -0700 | [diff] [blame] | 102 | * "CleanupMore": Clean up, and another GP is needed. |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 103 | */ |
Paul E. McKenney | bd9f068 | 2012-12-29 21:51:20 -0800 | [diff] [blame] | 104 | TRACE_EVENT(rcu_future_grace_period, |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 105 | |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 106 | TP_PROTO(const char *rcuname, unsigned long gp_seq, unsigned long c, |
| 107 | u8 level, int grplo, int grphi, const char *gpevent), |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 108 | |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 109 | TP_ARGS(rcuname, gp_seq, c, level, grplo, grphi, gpevent), |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 110 | |
| 111 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 112 | __field(const char *, rcuname) |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 113 | __field(unsigned long, gp_seq) |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 114 | __field(unsigned long, c) |
| 115 | __field(u8, level) |
| 116 | __field(int, grplo) |
| 117 | __field(int, grphi) |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 118 | __field(const char *, gpevent) |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 119 | ), |
| 120 | |
| 121 | TP_fast_assign( |
| 122 | __entry->rcuname = rcuname; |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 123 | __entry->gp_seq = gp_seq; |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 124 | __entry->c = c; |
| 125 | __entry->level = level; |
| 126 | __entry->grplo = grplo; |
| 127 | __entry->grphi = grphi; |
| 128 | __entry->gpevent = gpevent; |
| 129 | ), |
| 130 | |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 131 | TP_printk("%s %lu %lu %u %d %d %s", |
| 132 | __entry->rcuname, __entry->gp_seq, __entry->c, __entry->level, |
| 133 | __entry->grplo, __entry->grphi, __entry->gpevent) |
Paul E. McKenney | 09c7b89 | 2013-02-08 15:55:02 -0800 | [diff] [blame] | 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 | |
Paul E. McKenney | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 145 | TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level, |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 146 | int grplo, int grphi, unsigned long qsmask), |
| 147 | |
Paul E. McKenney | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 148 | TP_ARGS(rcuname, gp_seq, level, grplo, grphi, qsmask), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 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 | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 152 | __field(unsigned long, gp_seq) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 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; |
Paul E. McKenney | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 161 | __entry->gp_seq = gp_seq; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 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", |
Paul E. McKenney | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 169 | __entry->rcuname, __entry->gp_seq, __entry->level, |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 170 | __entry->grplo, __entry->grphi, __entry->qsmask) |
| 171 | ); |
| 172 | |
| 173 | /* |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 174 | * Tracepoint for expedited grace-period events. Takes a string identifying |
| 175 | * the RCU flavor, the expedited grace-period sequence number, and a string |
| 176 | * identifying the grace-period-related event as follows: |
| 177 | * |
| 178 | * "snap": Captured snapshot of expedited grace period sequence number. |
| 179 | * "start": Started a real expedited grace period. |
Paul E. McKenney | 9a41420 | 2018-01-31 19:23:24 -0800 | [diff] [blame] | 180 | * "reset": Started resetting the tree |
| 181 | * "select": Started selecting the CPUs to wait on. |
Paul E. McKenney | 7f5d42d | 2018-01-31 19:40:22 -0800 | [diff] [blame] | 182 | * "selectofl": Selected CPU partially offline. |
Paul E. McKenney | 9a41420 | 2018-01-31 19:23:24 -0800 | [diff] [blame] | 183 | * "startwait": Started waiting on selected CPUs. |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 184 | * "end": Ended a real expedited grace period. |
Paul E. McKenney | f6a12f3 | 2016-01-30 17:57:35 -0800 | [diff] [blame] | 185 | * "endwake": Woke piggybackers up. |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 186 | * "done": Someone else did the expedited grace period for us. |
| 187 | */ |
| 188 | TRACE_EVENT(rcu_exp_grace_period, |
| 189 | |
| 190 | TP_PROTO(const char *rcuname, unsigned long gpseq, const char *gpevent), |
| 191 | |
| 192 | TP_ARGS(rcuname, gpseq, gpevent), |
| 193 | |
| 194 | TP_STRUCT__entry( |
| 195 | __field(const char *, rcuname) |
| 196 | __field(unsigned long, gpseq) |
| 197 | __field(const char *, gpevent) |
| 198 | ), |
| 199 | |
| 200 | TP_fast_assign( |
| 201 | __entry->rcuname = rcuname; |
| 202 | __entry->gpseq = gpseq; |
| 203 | __entry->gpevent = gpevent; |
| 204 | ), |
| 205 | |
| 206 | TP_printk("%s %lu %s", |
| 207 | __entry->rcuname, __entry->gpseq, __entry->gpevent) |
| 208 | ); |
| 209 | |
| 210 | /* |
| 211 | * Tracepoint for expedited grace-period funnel-locking events. Takes a |
| 212 | * string identifying the RCU flavor, an integer identifying the rcu_node |
| 213 | * combining-tree level, another pair of integers identifying the lowest- |
| 214 | * and highest-numbered CPU associated with the current rcu_node structure, |
| 215 | * and a string. identifying the grace-period-related event as follows: |
| 216 | * |
Paul E. McKenney | f6a12f3 | 2016-01-30 17:57:35 -0800 | [diff] [blame] | 217 | * "nxtlvl": Advance to next level of rcu_node funnel |
| 218 | * "wait": Wait for someone else to do expedited GP |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 219 | */ |
| 220 | TRACE_EVENT(rcu_exp_funnel_lock, |
| 221 | |
| 222 | TP_PROTO(const char *rcuname, u8 level, int grplo, int grphi, |
| 223 | const char *gpevent), |
| 224 | |
| 225 | TP_ARGS(rcuname, level, grplo, grphi, gpevent), |
| 226 | |
| 227 | TP_STRUCT__entry( |
| 228 | __field(const char *, rcuname) |
| 229 | __field(u8, level) |
| 230 | __field(int, grplo) |
| 231 | __field(int, grphi) |
| 232 | __field(const char *, gpevent) |
| 233 | ), |
| 234 | |
| 235 | TP_fast_assign( |
| 236 | __entry->rcuname = rcuname; |
| 237 | __entry->level = level; |
| 238 | __entry->grplo = grplo; |
| 239 | __entry->grphi = grphi; |
| 240 | __entry->gpevent = gpevent; |
| 241 | ), |
| 242 | |
| 243 | TP_printk("%s %d %d %d %s", |
| 244 | __entry->rcuname, __entry->level, __entry->grplo, |
| 245 | __entry->grphi, __entry->gpevent) |
| 246 | ); |
| 247 | |
Steven Rostedt (VMware) | 9122caf | 2017-10-12 18:16:41 -0400 | [diff] [blame] | 248 | #ifdef CONFIG_RCU_NOCB_CPU |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 249 | /* |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 250 | * Tracepoint for RCU no-CBs CPU callback handoffs. This event is intended |
| 251 | * to assist debugging of these handoffs. |
| 252 | * |
| 253 | * The first argument is the name of the RCU flavor, and the second is |
| 254 | * the number of the offloaded CPU are extracted. The third and final |
| 255 | * argument is a string as follows: |
| 256 | * |
| 257 | * "WakeEmpty": Wake rcuo kthread, first CB to empty list. |
Paul E. McKenney | 9fdd3bc | 2014-07-29 14:50:47 -0700 | [diff] [blame] | 258 | * "WakeEmptyIsDeferred": Wake rcuo kthread later, first CB to empty list. |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 259 | * "WakeOvf": Wake rcuo kthread, CB list is huge. |
Paul E. McKenney | 9fdd3bc | 2014-07-29 14:50:47 -0700 | [diff] [blame] | 260 | * "WakeOvfIsDeferred": Wake rcuo kthread later, CB list is huge. |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 261 | * "WakeNot": Don't wake rcuo kthread. |
| 262 | * "WakeNotPoll": Don't wake rcuo kthread because it is polling. |
Paul E. McKenney | 9fdd3bc | 2014-07-29 14:50:47 -0700 | [diff] [blame] | 263 | * "DeferredWake": Carried out the "IsDeferred" wakeup. |
Paul E. McKenney | 69a79bb | 2013-08-15 13:23:23 -0700 | [diff] [blame] | 264 | * "Poll": Start of new polling cycle for rcu_nocb_poll. |
| 265 | * "Sleep": Sleep waiting for CBs for !rcu_nocb_poll. |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 266 | * "WokeEmpty": rcuo kthread woke to find empty list. |
| 267 | * "WokeNonEmpty": rcuo kthread woke to find non-empty list. |
Paul E. McKenney | 69a79bb | 2013-08-15 13:23:23 -0700 | [diff] [blame] | 268 | * "WaitQueue": Enqueue partially done, timed wait for it to complete. |
| 269 | * "WokeQueue": Partial enqueue now complete. |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 270 | */ |
| 271 | TRACE_EVENT(rcu_nocb_wake, |
| 272 | |
| 273 | TP_PROTO(const char *rcuname, int cpu, const char *reason), |
| 274 | |
| 275 | TP_ARGS(rcuname, cpu, reason), |
| 276 | |
| 277 | TP_STRUCT__entry( |
| 278 | __field(const char *, rcuname) |
| 279 | __field(int, cpu) |
| 280 | __field(const char *, reason) |
| 281 | ), |
| 282 | |
| 283 | TP_fast_assign( |
| 284 | __entry->rcuname = rcuname; |
| 285 | __entry->cpu = cpu; |
| 286 | __entry->reason = reason; |
| 287 | ), |
| 288 | |
| 289 | TP_printk("%s %d %s", __entry->rcuname, __entry->cpu, __entry->reason) |
| 290 | ); |
Steven Rostedt (VMware) | 9122caf | 2017-10-12 18:16:41 -0400 | [diff] [blame] | 291 | #endif |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 292 | |
| 293 | /* |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 294 | * Tracepoint for tasks blocking within preemptible-RCU read-side |
| 295 | * critical sections. Track the type of RCU (which one day might |
| 296 | * include SRCU), the grace-period number that the task is blocking |
| 297 | * (the current or the next), and the task's PID. |
| 298 | */ |
| 299 | TRACE_EVENT(rcu_preempt_task, |
| 300 | |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 301 | TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 302 | |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 303 | TP_ARGS(rcuname, pid, gp_seq), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 304 | |
| 305 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 306 | __field(const char *, rcuname) |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 307 | __field(unsigned long, gp_seq) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 308 | __field(int, pid) |
| 309 | ), |
| 310 | |
| 311 | TP_fast_assign( |
| 312 | __entry->rcuname = rcuname; |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 313 | __entry->gp_seq = gp_seq; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 314 | __entry->pid = pid; |
| 315 | ), |
| 316 | |
| 317 | TP_printk("%s %lu %d", |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 318 | __entry->rcuname, __entry->gp_seq, __entry->pid) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 319 | ); |
| 320 | |
| 321 | /* |
| 322 | * Tracepoint for tasks that blocked within a given preemptible-RCU |
| 323 | * read-side critical section exiting that critical section. Track the |
| 324 | * type of RCU (which one day might include SRCU) and the task's PID. |
| 325 | */ |
| 326 | TRACE_EVENT(rcu_unlock_preempted_task, |
| 327 | |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 328 | TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 329 | |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 330 | TP_ARGS(rcuname, gp_seq, pid), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 331 | |
| 332 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 333 | __field(const char *, rcuname) |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 334 | __field(unsigned long, gp_seq) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 335 | __field(int, pid) |
| 336 | ), |
| 337 | |
| 338 | TP_fast_assign( |
| 339 | __entry->rcuname = rcuname; |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 340 | __entry->gp_seq = gp_seq; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 341 | __entry->pid = pid; |
| 342 | ), |
| 343 | |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 344 | TP_printk("%s %lu %d", __entry->rcuname, __entry->gp_seq, __entry->pid) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 345 | ); |
| 346 | |
| 347 | /* |
| 348 | * Tracepoint for quiescent-state-reporting events. These are |
| 349 | * distinguished by the type of RCU, the grace-period number, the |
| 350 | * mask of quiescent lower-level entities, the rcu_node structure level, |
| 351 | * the starting and ending CPU covered by the rcu_node structure, and |
| 352 | * whether there are any blocked tasks blocking the current grace period. |
| 353 | * All but the type of RCU are extracted from the rcu_node structure. |
| 354 | */ |
| 355 | TRACE_EVENT(rcu_quiescent_state_report, |
| 356 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 357 | TP_PROTO(const char *rcuname, unsigned long gpnum, |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 358 | unsigned long mask, unsigned long qsmask, |
| 359 | u8 level, int grplo, int grphi, int gp_tasks), |
| 360 | |
| 361 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), |
| 362 | |
| 363 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 364 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 365 | __field(unsigned long, gpnum) |
| 366 | __field(unsigned long, mask) |
| 367 | __field(unsigned long, qsmask) |
| 368 | __field(u8, level) |
| 369 | __field(int, grplo) |
| 370 | __field(int, grphi) |
| 371 | __field(u8, gp_tasks) |
| 372 | ), |
| 373 | |
| 374 | TP_fast_assign( |
| 375 | __entry->rcuname = rcuname; |
| 376 | __entry->gpnum = gpnum; |
| 377 | __entry->mask = mask; |
| 378 | __entry->qsmask = qsmask; |
| 379 | __entry->level = level; |
| 380 | __entry->grplo = grplo; |
| 381 | __entry->grphi = grphi; |
| 382 | __entry->gp_tasks = gp_tasks; |
| 383 | ), |
| 384 | |
| 385 | TP_printk("%s %lu %lx>%lx %u %d %d %u", |
| 386 | __entry->rcuname, __entry->gpnum, |
| 387 | __entry->mask, __entry->qsmask, __entry->level, |
| 388 | __entry->grplo, __entry->grphi, __entry->gp_tasks) |
| 389 | ); |
| 390 | |
| 391 | /* |
| 392 | * Tracepoint for quiescent states detected by force_quiescent_state(). |
Paul E. McKenney | 3a19b46 | 2016-11-30 11:21:21 -0800 | [diff] [blame] | 393 | * These trace events include the type of RCU, the grace-period number that |
| 394 | * was blocked by the CPU, the CPU itself, and the type of quiescent state, |
| 395 | * which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, "kick" |
| 396 | * when kicking a CPU that has been in dyntick-idle mode for too long, or |
| 397 | * "rqc" if the CPU got a quiescent state via its rcu_qs_ctr. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 398 | */ |
| 399 | TRACE_EVENT(rcu_fqs, |
| 400 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 401 | 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] | 402 | |
| 403 | TP_ARGS(rcuname, gpnum, cpu, qsevent), |
| 404 | |
| 405 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 406 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 407 | __field(unsigned long, gpnum) |
| 408 | __field(int, cpu) |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 409 | __field(const char *, qsevent) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 410 | ), |
| 411 | |
| 412 | TP_fast_assign( |
| 413 | __entry->rcuname = rcuname; |
| 414 | __entry->gpnum = gpnum; |
| 415 | __entry->cpu = cpu; |
| 416 | __entry->qsevent = qsevent; |
| 417 | ), |
| 418 | |
| 419 | TP_printk("%s %lu %d %s", |
| 420 | __entry->rcuname, __entry->gpnum, |
| 421 | __entry->cpu, __entry->qsevent) |
| 422 | ); |
| 423 | |
Pranith Kumar | 28f6569 | 2014-09-22 14:00:48 -0400 | [diff] [blame] | 424 | #endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) */ |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 425 | |
| 426 | /* |
| 427 | * Tracepoint for dyntick-idle entry/exit events. These take a string |
Paul E. McKenney | bd2b879 | 2017-10-04 12:29:01 -0700 | [diff] [blame] | 428 | * as argument: "Start" for entering dyntick-idle mode, "Startirq" for |
| 429 | * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it |
| 430 | * to irq/NMI, "--=" for events moving towards idle, and "++=" for events |
Paul E. McKenney | e68bbb2 | 2017-10-05 19:55:31 -0700 | [diff] [blame] | 431 | * moving away from idle. |
Paul E. McKenney | 045fb93 | 2011-11-22 12:13:03 -0800 | [diff] [blame] | 432 | * |
| 433 | * These events also take a pair of numbers, which indicate the nesting |
Paul E. McKenney | e68bbb2 | 2017-10-05 19:55:31 -0700 | [diff] [blame] | 434 | * depth before and after the event of interest, and a third number that is |
| 435 | * the ->dynticks counter. Note that task-related and interrupt-related |
| 436 | * events use two separate counters, and that the "++=" and "--=" events |
| 437 | * for irq/NMI will change the counter by two, otherwise by one. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 438 | */ |
| 439 | TRACE_EVENT(rcu_dyntick, |
| 440 | |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 441 | TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 442 | |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 443 | TP_ARGS(polarity, oldnesting, newnesting, dynticks), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 444 | |
| 445 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 446 | __field(const char *, polarity) |
Paul E. McKenney | 84585aa | 2017-10-04 15:55:16 -0700 | [diff] [blame] | 447 | __field(long, oldnesting) |
| 448 | __field(long, newnesting) |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 449 | __field(int, dynticks) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 450 | ), |
| 451 | |
| 452 | TP_fast_assign( |
| 453 | __entry->polarity = polarity; |
Paul E. McKenney | 4145fa7 | 2011-10-31 15:01:54 -0700 | [diff] [blame] | 454 | __entry->oldnesting = oldnesting; |
| 455 | __entry->newnesting = newnesting; |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 456 | __entry->dynticks = atomic_read(&dynticks); |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 457 | ), |
| 458 | |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 459 | TP_printk("%s %lx %lx %#3x", __entry->polarity, |
| 460 | __entry->oldnesting, __entry->newnesting, |
| 461 | __entry->dynticks & 0xfff) |
Paul E. McKenney | 433cddd | 2011-11-22 14:58:03 -0800 | [diff] [blame] | 462 | ); |
| 463 | |
| 464 | /* |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 465 | * Tracepoint for the registration of a single RCU callback function. |
| 466 | * 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] | 467 | * a pointer to the RCU callback itself, the third element is the |
| 468 | * number of lazy callbacks queued, and the fourth element is the |
| 469 | * total number of callbacks queued. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 470 | */ |
| 471 | TRACE_EVENT(rcu_callback, |
| 472 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 473 | 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] | 474 | long qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 475 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 476 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 477 | |
| 478 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 479 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 480 | __field(void *, rhp) |
| 481 | __field(void *, func) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 482 | __field(long, qlen_lazy) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 483 | __field(long, qlen) |
| 484 | ), |
| 485 | |
| 486 | TP_fast_assign( |
| 487 | __entry->rcuname = rcuname; |
| 488 | __entry->rhp = rhp; |
| 489 | __entry->func = rhp->func; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 490 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 491 | __entry->qlen = qlen; |
| 492 | ), |
| 493 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 494 | TP_printk("%s rhp=%p func=%pf %ld/%ld", |
| 495 | __entry->rcuname, __entry->rhp, __entry->func, |
| 496 | __entry->qlen_lazy, __entry->qlen) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 497 | ); |
| 498 | |
| 499 | /* |
| 500 | * Tracepoint for the registration of a single RCU callback of the special |
| 501 | * kfree() form. The first argument is the RCU type, the second argument |
| 502 | * is a pointer to the RCU callback, the third argument is the offset |
| 503 | * of the callback within the enclosing RCU-protected data structure, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 504 | * the fourth argument is the number of lazy callbacks queued, and the |
| 505 | * fifth argument is the total number of callbacks queued. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 506 | */ |
| 507 | TRACE_EVENT(rcu_kfree_callback, |
| 508 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 509 | 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] | 510 | long qlen_lazy, long qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 511 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 512 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 513 | |
| 514 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 515 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 516 | __field(void *, rhp) |
| 517 | __field(unsigned long, offset) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 518 | __field(long, qlen_lazy) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 519 | __field(long, qlen) |
| 520 | ), |
| 521 | |
| 522 | TP_fast_assign( |
| 523 | __entry->rcuname = rcuname; |
| 524 | __entry->rhp = rhp; |
| 525 | __entry->offset = offset; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 526 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 527 | __entry->qlen = qlen; |
| 528 | ), |
| 529 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 530 | TP_printk("%s rhp=%p func=%ld %ld/%ld", |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 531 | __entry->rcuname, __entry->rhp, __entry->offset, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 532 | __entry->qlen_lazy, __entry->qlen) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 533 | ); |
| 534 | |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 535 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 536 | * Tracepoint for marking the beginning rcu_do_batch, performed to start |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 537 | * RCU callback invocation. The first argument is the RCU flavor, |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 538 | * the second is the number of lazy callbacks queued, the third is |
| 539 | * the total number of callbacks queued, and the fourth argument is |
| 540 | * the current RCU-callback batch limit. |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 541 | */ |
| 542 | TRACE_EVENT(rcu_batch_start, |
| 543 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 544 | 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] | 545 | |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 546 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 547 | |
| 548 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 549 | __field(const char *, rcuname) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 550 | __field(long, qlen_lazy) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 551 | __field(long, qlen) |
Paul E. McKenney | 3aac7a8 | 2012-11-14 14:37:29 -0800 | [diff] [blame] | 552 | __field(long, blimit) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 553 | ), |
| 554 | |
| 555 | TP_fast_assign( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 556 | __entry->rcuname = rcuname; |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 557 | __entry->qlen_lazy = qlen_lazy; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 558 | __entry->qlen = qlen; |
| 559 | __entry->blimit = blimit; |
| 560 | ), |
| 561 | |
Paul E. McKenney | 3aac7a8 | 2012-11-14 14:37:29 -0800 | [diff] [blame] | 562 | TP_printk("%s CBs=%ld/%ld bl=%ld", |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 563 | __entry->rcuname, __entry->qlen_lazy, __entry->qlen, |
| 564 | __entry->blimit) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 565 | ); |
| 566 | |
| 567 | /* |
| 568 | * Tracepoint for the invocation of a single RCU callback function. |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 569 | * The first argument is the type of RCU, and the second argument is |
| 570 | * a pointer to the RCU callback itself. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 571 | */ |
| 572 | TRACE_EVENT(rcu_invoke_callback, |
| 573 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 574 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 575 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 576 | TP_ARGS(rcuname, rhp), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 577 | |
| 578 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 579 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 580 | __field(void *, rhp) |
| 581 | __field(void *, func) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 582 | ), |
| 583 | |
| 584 | TP_fast_assign( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 585 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 586 | __entry->rhp = rhp; |
| 587 | __entry->func = rhp->func; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 588 | ), |
| 589 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 590 | TP_printk("%s rhp=%p func=%pf", |
| 591 | __entry->rcuname, __entry->rhp, __entry->func) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 592 | ); |
| 593 | |
| 594 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 595 | * 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] | 596 | * kfree() form. The first argument is the RCU flavor, the second |
| 597 | * argument is a pointer to the RCU callback, and the third argument |
| 598 | * is the offset of the callback within the enclosing RCU-protected |
| 599 | * data structure. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 600 | */ |
| 601 | TRACE_EVENT(rcu_invoke_kfree_callback, |
| 602 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 603 | 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] | 604 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 605 | TP_ARGS(rcuname, rhp, offset), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 606 | |
| 607 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 608 | __field(const char *, rcuname) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 609 | __field(void *, rhp) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 610 | __field(unsigned long, offset) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 611 | ), |
| 612 | |
| 613 | TP_fast_assign( |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 614 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 615 | __entry->rhp = rhp; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 616 | __entry->offset = offset; |
| 617 | ), |
| 618 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 619 | TP_printk("%s rhp=%p func=%ld", |
| 620 | __entry->rcuname, __entry->rhp, __entry->offset) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 621 | ); |
| 622 | |
| 623 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 624 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 625 | * invoked. The first argument is the name of the RCU flavor, |
| 626 | * the second argument is number of callbacks actually invoked, |
| 627 | * the third argument (cb) is whether or not any of the callbacks that |
| 628 | * were ready to invoke at the beginning of this batch are still |
| 629 | * queued, the fourth argument (nr) is the return value of need_resched(), |
| 630 | * the fifth argument (iit) is 1 if the current task is the idle task, |
| 631 | * and the sixth argument (risk) is the return value from |
| 632 | * rcu_is_callbacks_kthread(). |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 633 | */ |
| 634 | TRACE_EVENT(rcu_batch_end, |
| 635 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 636 | TP_PROTO(const char *rcuname, int callbacks_invoked, |
Paul E. McKenney | 15f5191 | 2013-08-18 11:59:25 -0700 | [diff] [blame] | 637 | char cb, char nr, char iit, char risk), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 638 | |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 639 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 640 | |
| 641 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 642 | __field(const char *, rcuname) |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 643 | __field(int, callbacks_invoked) |
Paul E. McKenney | 15f5191 | 2013-08-18 11:59:25 -0700 | [diff] [blame] | 644 | __field(char, cb) |
| 645 | __field(char, nr) |
| 646 | __field(char, iit) |
| 647 | __field(char, risk) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 648 | ), |
| 649 | |
| 650 | TP_fast_assign( |
Paul E. McKenney | 72fe701 | 2011-06-21 01:14:54 -0700 | [diff] [blame] | 651 | __entry->rcuname = rcuname; |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame] | 652 | __entry->callbacks_invoked = callbacks_invoked; |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 653 | __entry->cb = cb; |
| 654 | __entry->nr = nr; |
| 655 | __entry->iit = iit; |
| 656 | __entry->risk = risk; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 657 | ), |
| 658 | |
Paul E. McKenney | 4968c30 | 2011-12-07 16:32:40 -0800 | [diff] [blame] | 659 | TP_printk("%s CBs-invoked=%d idle=%c%c%c%c", |
| 660 | __entry->rcuname, __entry->callbacks_invoked, |
| 661 | __entry->cb ? 'C' : '.', |
| 662 | __entry->nr ? 'S' : '.', |
| 663 | __entry->iit ? 'I' : '.', |
| 664 | __entry->risk ? 'R' : '.') |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 665 | ); |
| 666 | |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 667 | /* |
| 668 | * Tracepoint for rcutorture readers. The first argument is the name |
| 669 | * of the RCU flavor from rcutorture's viewpoint and the second argument |
Paul E. McKenney | d0af39e | 2016-10-10 18:26:04 -0700 | [diff] [blame] | 670 | * is the callback address. The third argument is the start time in |
| 671 | * seconds, and the last two arguments are the grace period numbers |
| 672 | * at the beginning and end of the read, respectively. Note that the |
| 673 | * callback address can be NULL. |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 674 | */ |
Paul E. McKenney | b3c9831 | 2017-06-06 16:39:00 -0700 | [diff] [blame] | 675 | #define RCUTORTURENAME_LEN 8 |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 676 | TRACE_EVENT(rcu_torture_read, |
| 677 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 678 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 679 | unsigned long secs, unsigned long c_old, unsigned long c), |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 680 | |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 681 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 682 | |
| 683 | TP_STRUCT__entry( |
Paul E. McKenney | b3c9831 | 2017-06-06 16:39:00 -0700 | [diff] [blame] | 684 | __field(char, rcutorturename[RCUTORTURENAME_LEN]) |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 685 | __field(struct rcu_head *, rhp) |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 686 | __field(unsigned long, secs) |
| 687 | __field(unsigned long, c_old) |
| 688 | __field(unsigned long, c) |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 689 | ), |
| 690 | |
| 691 | TP_fast_assign( |
Paul E. McKenney | b3c9831 | 2017-06-06 16:39:00 -0700 | [diff] [blame] | 692 | strncpy(__entry->rcutorturename, rcutorturename, |
| 693 | RCUTORTURENAME_LEN); |
| 694 | __entry->rcutorturename[RCUTORTURENAME_LEN - 1] = 0; |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 695 | __entry->rhp = rhp; |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 696 | __entry->secs = secs; |
| 697 | __entry->c_old = c_old; |
| 698 | __entry->c = c; |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 699 | ), |
| 700 | |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 701 | TP_printk("%s torture read %p %luus c: %lu %lu", |
| 702 | __entry->rcutorturename, __entry->rhp, |
| 703 | __entry->secs, __entry->c_old, __entry->c) |
Paul E. McKenney | 91afaf3 | 2011-10-02 07:44:32 -0700 | [diff] [blame] | 704 | ); |
| 705 | |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 706 | /* |
| 707 | * Tracepoint for _rcu_barrier() execution. The string "s" describes |
| 708 | * the _rcu_barrier phase: |
Paul E. McKenney | d7e2993 | 2014-10-27 09:15:54 -0700 | [diff] [blame] | 709 | * "Begin": _rcu_barrier() started. |
Paul E. McKenney | d7e2993 | 2014-10-27 09:15:54 -0700 | [diff] [blame] | 710 | * "EarlyExit": _rcu_barrier() piggybacked, thus early exit. |
| 711 | * "Inc1": _rcu_barrier() piggyback check counter incremented. |
| 712 | * "OfflineNoCB": _rcu_barrier() found callback on never-online CPU |
| 713 | * "OnlineNoCB": _rcu_barrier() found online no-CBs CPU. |
| 714 | * "OnlineQ": _rcu_barrier() found online CPU with callbacks. |
| 715 | * "OnlineNQ": _rcu_barrier() found online CPU, no callbacks. |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 716 | * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. |
Paul E. McKenney | f92c734 | 2017-04-10 15:40:35 -0700 | [diff] [blame] | 717 | * "IRQNQ": An rcu_barrier_callback() callback found no callbacks. |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 718 | * "CB": An rcu_barrier_callback() invoked a callback, not the last. |
| 719 | * "LastCB": An rcu_barrier_callback() invoked the last callback. |
Paul E. McKenney | d7e2993 | 2014-10-27 09:15:54 -0700 | [diff] [blame] | 720 | * "Inc2": _rcu_barrier() piggyback check counter incremented. |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 721 | * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument |
| 722 | * is the count of remaining callbacks, and "done" is the piggybacking count. |
| 723 | */ |
| 724 | TRACE_EVENT(rcu_barrier, |
| 725 | |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 726 | 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] | 727 | |
| 728 | TP_ARGS(rcuname, s, cpu, cnt, done), |
| 729 | |
| 730 | TP_STRUCT__entry( |
Steven Rostedt (Red Hat) | e66c33d | 2013-07-12 16:50:28 -0400 | [diff] [blame] | 731 | __field(const char *, rcuname) |
| 732 | __field(const char *, s) |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 733 | __field(int, cpu) |
| 734 | __field(int, cnt) |
| 735 | __field(unsigned long, done) |
| 736 | ), |
| 737 | |
| 738 | TP_fast_assign( |
| 739 | __entry->rcuname = rcuname; |
| 740 | __entry->s = s; |
| 741 | __entry->cpu = cpu; |
| 742 | __entry->cnt = cnt; |
| 743 | __entry->done = done; |
| 744 | ), |
| 745 | |
| 746 | TP_printk("%s %s cpu %d remaining %d # %lu", |
| 747 | __entry->rcuname, __entry->s, __entry->cpu, __entry->cnt, |
| 748 | __entry->done) |
| 749 | ); |
| 750 | |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 751 | #else /* #ifdef CONFIG_RCU_TRACE */ |
| 752 | |
Paul E. McKenney | 477351f | 2018-05-01 12:54:11 -0700 | [diff] [blame] | 753 | #define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0) |
Paul E. McKenney | abd13fd | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 754 | #define trace_rcu_future_grace_period(rcuname, gp_seq, c, \ |
Paul E. McKenney | bd9f068 | 2012-12-29 21:51:20 -0800 | [diff] [blame] | 755 | level, grplo, grphi, event) \ |
| 756 | do { } while (0) |
Paul E. McKenney | 63d86a7 | 2018-05-01 13:08:46 -0700 | [diff] [blame] | 757 | #define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \ |
Paul E. McKenney | e087816 | 2016-01-28 20:25:09 -0800 | [diff] [blame] | 758 | qsmask) do { } while (0) |
| 759 | #define trace_rcu_exp_grace_period(rcuname, gqseq, gpevent) \ |
| 760 | do { } while (0) |
| 761 | #define trace_rcu_exp_funnel_lock(rcuname, level, grplo, grphi, gpevent) \ |
| 762 | do { } while (0) |
Paul E. McKenney | 9261dd0 | 2013-08-14 16:24:26 -0700 | [diff] [blame] | 763 | #define trace_rcu_nocb_wake(rcuname, cpu, reason) do { } while (0) |
Paul E. McKenney | 598ce09 | 2018-05-01 13:35:20 -0700 | [diff] [blame] | 764 | #define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0) |
Paul E. McKenney | 865aa1e | 2018-05-01 13:35:20 -0700 | [diff] [blame^] | 765 | #define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 766 | #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ |
| 767 | grplo, grphi, gp_tasks) do { } \ |
| 768 | while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 769 | #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) |
Paul E. McKenney | dec9890 | 2017-10-04 16:24:29 -0700 | [diff] [blame] | 770 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0) |
Paul E. McKenney | 486e259 | 2012-01-06 14:11:30 -0800 | [diff] [blame] | 771 | #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) |
| 772 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ |
| 773 | do { } while (0) |
| 774 | #define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ |
| 775 | do { } while (0) |
Paul E. McKenney | d4c08f2 | 2011-06-25 06:36:56 -0700 | [diff] [blame] | 776 | #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) |
| 777 | #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] | 778 | #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ |
| 779 | do { } while (0) |
Paul E. McKenney | 5249453 | 2012-11-14 16:26:40 -0800 | [diff] [blame] | 780 | #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
| 781 | do { } while (0) |
Paul E. McKenney | a83eff0 | 2012-05-23 18:47:05 -0700 | [diff] [blame] | 782 | #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] | 783 | |
| 784 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ |
| 785 | |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 786 | #endif /* _TRACE_RCU_H */ |
| 787 | |
| 788 | /* This part must be outside protection */ |
| 789 | #include <trace/define_trace.h> |