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