Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM rcu |
| 3 | |
| 4 | #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_RCU_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
| 9 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 10 | * Tracepoint for start/end markers used for utilization calculations. |
| 11 | * By convention, the string is of the following forms: |
| 12 | * |
| 13 | * "Start <activity>" -- Mark the start of the specified activity, |
| 14 | * such as "context switch". Nesting is permitted. |
| 15 | * "End <activity>" -- Mark the end of the specified activity. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 16 | */ |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 17 | TRACE_EVENT(rcu_utilization, |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 18 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 19 | TP_PROTO(char *s), |
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 | TP_ARGS(s), |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 22 | |
| 23 | TP_STRUCT__entry( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 24 | __field(char *, s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 25 | ), |
| 26 | |
| 27 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 28 | __entry->s = s; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 29 | ), |
| 30 | |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 31 | TP_printk("%s", __entry->s) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 32 | ); |
| 33 | |
| 34 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 35 | * Tracepoint for marking the beginning rcu_do_batch, performed to start |
| 36 | * RCU callback invocation. The first argument is the total number of |
| 37 | * callbacks (including those that are not yet ready to be invoked), |
| 38 | * and the second argument is the current RCU-callback batch limit. |
| 39 | */ |
| 40 | TRACE_EVENT(rcu_batch_start, |
| 41 | |
| 42 | TP_PROTO(long qlen, int blimit), |
| 43 | |
| 44 | TP_ARGS(qlen, blimit), |
| 45 | |
| 46 | TP_STRUCT__entry( |
| 47 | __field(long, qlen) |
| 48 | __field(int, blimit) |
| 49 | ), |
| 50 | |
| 51 | TP_fast_assign( |
| 52 | __entry->qlen = qlen; |
| 53 | __entry->blimit = blimit; |
| 54 | ), |
| 55 | |
| 56 | TP_printk("CBs=%ld bl=%d", __entry->qlen, __entry->blimit) |
| 57 | ); |
| 58 | |
| 59 | /* |
| 60 | * Tracepoint for the invocation of a single RCU callback function. |
| 61 | * The argument is a pointer to the RCU callback itself. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 62 | */ |
| 63 | TRACE_EVENT(rcu_invoke_callback, |
| 64 | |
| 65 | TP_PROTO(struct rcu_head *rhp), |
| 66 | |
| 67 | TP_ARGS(rhp), |
| 68 | |
| 69 | TP_STRUCT__entry( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 70 | __field(void *, rhp) |
| 71 | __field(void *, func) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 72 | ), |
| 73 | |
| 74 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 75 | __entry->rhp = rhp; |
| 76 | __entry->func = rhp->func; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 77 | ), |
| 78 | |
| 79 | TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func) |
| 80 | ); |
| 81 | |
| 82 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 83 | * Tracepoint for the invocation of a single RCU callback of the special |
| 84 | * kfree() form. The first argument is a pointer to the RCU callback |
| 85 | * and the second argument is the offset of the callback within the |
| 86 | * enclosing RCU-protected data structure. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 87 | */ |
| 88 | TRACE_EVENT(rcu_invoke_kfree_callback, |
| 89 | |
| 90 | TP_PROTO(struct rcu_head *rhp, unsigned long offset), |
| 91 | |
| 92 | TP_ARGS(rhp, offset), |
| 93 | |
| 94 | TP_STRUCT__entry( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 95 | __field(void *, rhp) |
| 96 | __field(unsigned long, offset) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 97 | ), |
| 98 | |
| 99 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 100 | __entry->rhp = rhp; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 101 | __entry->offset = offset; |
| 102 | ), |
| 103 | |
| 104 | TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset) |
| 105 | ); |
| 106 | |
| 107 | /* |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 108 | * Tracepoint for exiting rcu_do_batch after RCU callbacks have been |
| 109 | * invoked. The first argument is the number of callbacks actually invoked. |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 110 | */ |
| 111 | TRACE_EVENT(rcu_batch_end, |
| 112 | |
| 113 | TP_PROTO(int callbacks_invoked), |
| 114 | |
| 115 | TP_ARGS(callbacks_invoked), |
| 116 | |
| 117 | TP_STRUCT__entry( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 118 | __field(int, callbacks_invoked) |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 119 | ), |
| 120 | |
| 121 | TP_fast_assign( |
Paul E. McKenney | 300df91 | 2011-06-18 22:26:31 -0700 | [diff] [blame^] | 122 | __entry->callbacks_invoked = callbacks_invoked; |
Paul E. McKenney | 29c00b4 | 2011-06-17 15:53:19 -0700 | [diff] [blame] | 123 | ), |
| 124 | |
| 125 | TP_printk("CBs-invoked=%d", __entry->callbacks_invoked) |
| 126 | ); |
| 127 | |
| 128 | #endif /* _TRACE_RCU_H */ |
| 129 | |
| 130 | /* This part must be outside protection */ |
| 131 | #include <trace/define_trace.h> |