rcu.h 20 KB

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