| 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM jbd |
| 3 | |
| 4 | #if !defined(_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_JBD_H |
| 6 | |
| 7 | #include <linux/jbd.h> |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
| 10 | TRACE_EVENT(jbd_checkpoint, |
| 11 | |
| 12 | TP_PROTO(journal_t *journal, int result), |
| 13 | |
| 14 | TP_ARGS(journal, result), |
| 15 | |
| 16 | TP_STRUCT__entry( |
| 17 | __field( dev_t, dev ) |
| 18 | __field( int, result ) |
| 19 | ), |
| 20 | |
| 21 | TP_fast_assign( |
| 22 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 23 | tp_assign(result, result); |
| 24 | ), |
| 25 | |
| 26 | TP_printk("dev %d,%d result %d", |
| 27 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 28 | __entry->result) |
| 29 | ) |
| 30 | |
| 31 | DECLARE_EVENT_CLASS(jbd_commit, |
| 32 | |
| 33 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 34 | |
| 35 | TP_ARGS(journal, commit_transaction), |
| 36 | |
| 37 | TP_STRUCT__entry( |
| 38 | __field( dev_t, dev ) |
| 39 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 40 | __field( char, sync_commit ) |
| 41 | #endif |
| 42 | __field( int, transaction ) |
| 43 | ), |
| 44 | |
| 45 | TP_fast_assign( |
| 46 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 47 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 48 | tp_assign(sync_commit, commit_transaction->t_synchronous_commit); |
| 49 | #endif |
| 50 | tp_assign(transaction, commit_transaction->t_tid); |
| 51 | ), |
| 52 | |
| 53 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 54 | TP_printk("dev %d,%d transaction %d sync %d", |
| 55 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 56 | __entry->transaction, __entry->sync_commit) |
| 57 | #else |
| 58 | TP_printk("dev %d,%d transaction %d", |
| 59 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 60 | __entry->transaction) |
| 61 | #endif |
| 62 | ) |
| 63 | |
| 64 | DEFINE_EVENT(jbd_commit, jbd_start_commit, |
| 65 | |
| 66 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 67 | |
| 68 | TP_ARGS(journal, commit_transaction) |
| 69 | ) |
| 70 | |
| 71 | DEFINE_EVENT(jbd_commit, jbd_commit_locking, |
| 72 | |
| 73 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 74 | |
| 75 | TP_ARGS(journal, commit_transaction) |
| 76 | ) |
| 77 | |
| 78 | DEFINE_EVENT(jbd_commit, jbd_commit_flushing, |
| 79 | |
| 80 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 81 | |
| 82 | TP_ARGS(journal, commit_transaction) |
| 83 | ) |
| 84 | |
| 85 | DEFINE_EVENT(jbd_commit, jbd_commit_logging, |
| 86 | |
| 87 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 88 | |
| 89 | TP_ARGS(journal, commit_transaction) |
| 90 | ) |
| 91 | |
| 92 | TRACE_EVENT(jbd_drop_transaction, |
| 93 | |
| 94 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 95 | |
| 96 | TP_ARGS(journal, commit_transaction), |
| 97 | |
| 98 | TP_STRUCT__entry( |
| 99 | __field( dev_t, dev ) |
| 100 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 101 | __field( char, sync_commit ) |
| 102 | #endif |
| 103 | __field( int, transaction ) |
| 104 | ), |
| 105 | |
| 106 | TP_fast_assign( |
| 107 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 108 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 109 | tp_assign(sync_commit, commit_transaction->t_synchronous_commit); |
| 110 | #endif |
| 111 | tp_assign(transaction, commit_transaction->t_tid); |
| 112 | ), |
| 113 | |
| 114 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 115 | TP_printk("dev %d,%d transaction %d sync %d", |
| 116 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 117 | __entry->transaction, __entry->sync_commit) |
| 118 | #else |
| 119 | TP_printk("dev %d,%d transaction %d", |
| 120 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 121 | __entry->transaction) |
| 122 | #endif |
| 123 | ) |
| 124 | |
| 125 | TRACE_EVENT(jbd_end_commit, |
| 126 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 127 | |
| 128 | TP_ARGS(journal, commit_transaction), |
| 129 | |
| 130 | TP_STRUCT__entry( |
| 131 | __field( dev_t, dev ) |
| 132 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 133 | __field( char, sync_commit ) |
| 134 | #endif |
| 135 | __field( int, transaction ) |
| 136 | __field( int, head ) |
| 137 | ), |
| 138 | |
| 139 | TP_fast_assign( |
| 140 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 141 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 142 | tp_assign(sync_commit, commit_transaction->t_synchronous_commit); |
| 143 | #endif |
| 144 | tp_assign(transaction, commit_transaction->t_tid); |
| 145 | tp_assign(head, journal->j_tail_sequence); |
| 146 | ), |
| 147 | |
| 148 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 149 | TP_printk("dev %d,%d transaction %d sync %d head %d", |
| 150 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 151 | __entry->transaction, __entry->sync_commit, __entry->head) |
| 152 | #else |
| 153 | TP_printk("dev %d,%d transaction %d head %d", |
| 154 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 155 | __entry->transaction, __entry->head) |
| 156 | #endif |
| 157 | ) |
| 158 | |
| 159 | TRACE_EVENT(jbd_do_submit_data, |
| 160 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 161 | |
| 162 | TP_ARGS(journal, commit_transaction), |
| 163 | |
| 164 | TP_STRUCT__entry( |
| 165 | __field( dev_t, dev ) |
| 166 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 167 | __field( char, sync_commit ) |
| 168 | #endif |
| 169 | __field( int, transaction ) |
| 170 | ), |
| 171 | |
| 172 | TP_fast_assign( |
| 173 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 174 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 175 | tp_assign(sync_commit, commit_transaction->t_synchronous_commit); |
| 176 | #endif |
| 177 | tp_assign(transaction, commit_transaction->t_tid); |
| 178 | ), |
| 179 | |
| 180 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) |
| 181 | TP_printk("dev %d,%d transaction %d sync %d", |
| 182 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 183 | __entry->transaction, __entry->sync_commit) |
| 184 | #else |
| 185 | TP_printk("dev %d,%d transaction %d", |
| 186 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 187 | __entry->transaction) |
| 188 | #endif |
| 189 | ) |
| 190 | |
| 191 | TRACE_EVENT(jbd_cleanup_journal_tail, |
| 192 | |
| 193 | TP_PROTO(journal_t *journal, tid_t first_tid, |
| 194 | unsigned long block_nr, unsigned long freed), |
| 195 | |
| 196 | TP_ARGS(journal, first_tid, block_nr, freed), |
| 197 | |
| 198 | TP_STRUCT__entry( |
| 199 | __field( dev_t, dev ) |
| 200 | __field( tid_t, tail_sequence ) |
| 201 | __field( tid_t, first_tid ) |
| 202 | __field(unsigned long, block_nr ) |
| 203 | __field(unsigned long, freed ) |
| 204 | ), |
| 205 | |
| 206 | TP_fast_assign( |
| 207 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 208 | tp_assign(tail_sequence, journal->j_tail_sequence); |
| 209 | tp_assign(first_tid, first_tid); |
| 210 | tp_assign(block_nr, block_nr); |
| 211 | tp_assign(freed, freed); |
| 212 | ), |
| 213 | |
| 214 | TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", |
| 215 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 216 | __entry->tail_sequence, __entry->first_tid, |
| 217 | __entry->block_nr, __entry->freed) |
| 218 | ) |
| 219 | |
| 220 | TRACE_EVENT(jbd_update_superblock_end, |
| 221 | TP_PROTO(journal_t *journal, int wait), |
| 222 | |
| 223 | TP_ARGS(journal, wait), |
| 224 | |
| 225 | TP_STRUCT__entry( |
| 226 | __field( dev_t, dev ) |
| 227 | __field( int, wait ) |
| 228 | ), |
| 229 | |
| 230 | TP_fast_assign( |
| 231 | tp_assign(dev, journal->j_fs_dev->bd_dev); |
| 232 | tp_assign(wait, wait); |
| 233 | ), |
| 234 | |
| 235 | TP_printk("dev %d,%d wait %d", |
| 236 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 237 | __entry->wait) |
| 238 | ) |
| 239 | |
| 240 | #endif /* _TRACE_JBD_H */ |
| 241 | |
| 242 | /* This part must be outside protection */ |
| 243 | #include "../../../probes/define_trace.h" |