Li Zefan | d0b6e04 | 2009-07-13 10:33:21 +0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM jbd2 |
| 3 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 4 | #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_JBD2_H |
| 6 | |
| 7 | #include <linux/jbd2.h> |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 10 | struct transaction_chp_stats_s; |
| 11 | struct transaction_run_stats_s; |
| 12 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 13 | TRACE_EVENT(jbd2_checkpoint, |
| 14 | |
| 15 | TP_PROTO(journal_t *journal, int result), |
| 16 | |
| 17 | TP_ARGS(journal, result), |
| 18 | |
| 19 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 20 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 21 | __field( int, result ) |
| 22 | ), |
| 23 | |
| 24 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 25 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 26 | __entry->result = result; |
| 27 | ), |
| 28 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 29 | TP_printk("dev %d,%d result %d", |
| 30 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 31 | ); |
| 32 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 33 | DECLARE_EVENT_CLASS(jbd2_commit, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 34 | |
| 35 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 36 | |
| 37 | TP_ARGS(journal, commit_transaction), |
| 38 | |
| 39 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 40 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 41 | __field( char, sync_commit ) |
| 42 | __field( int, transaction ) |
| 43 | ), |
| 44 | |
| 45 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 46 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 47 | __entry->sync_commit = commit_transaction->t_synchronous_commit; |
| 48 | __entry->transaction = commit_transaction->t_tid; |
| 49 | ), |
| 50 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 51 | TP_printk("dev %d,%d transaction %d sync %d", |
| 52 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 53 | __entry->transaction, __entry->sync_commit) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 54 | ); |
| 55 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 56 | DEFINE_EVENT(jbd2_commit, jbd2_start_commit, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 57 | |
| 58 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 59 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 60 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 61 | ); |
| 62 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 63 | DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 64 | |
| 65 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 66 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 67 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 68 | ); |
| 69 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 70 | DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 71 | |
| 72 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 73 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 74 | TP_ARGS(journal, commit_transaction) |
| 75 | ); |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 76 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 77 | DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 78 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 79 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 80 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 81 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 82 | ); |
| 83 | |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 84 | DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction, |
| 85 | |
| 86 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 87 | |
| 88 | TP_ARGS(journal, commit_transaction) |
| 89 | ); |
| 90 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 91 | TRACE_EVENT(jbd2_end_commit, |
| 92 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 93 | |
| 94 | TP_ARGS(journal, commit_transaction), |
| 95 | |
| 96 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 97 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 98 | __field( char, sync_commit ) |
| 99 | __field( int, transaction ) |
| 100 | __field( int, head ) |
| 101 | ), |
| 102 | |
| 103 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 104 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 105 | __entry->sync_commit = commit_transaction->t_synchronous_commit; |
| 106 | __entry->transaction = commit_transaction->t_tid; |
| 107 | __entry->head = journal->j_tail_sequence; |
| 108 | ), |
| 109 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 110 | TP_printk("dev %d,%d transaction %d sync %d head %d", |
| 111 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 112 | __entry->transaction, __entry->sync_commit, __entry->head) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 113 | ); |
| 114 | |
| 115 | TRACE_EVENT(jbd2_submit_inode_data, |
| 116 | TP_PROTO(struct inode *inode), |
| 117 | |
| 118 | TP_ARGS(inode), |
| 119 | |
| 120 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 121 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 122 | __field( ino_t, ino ) |
| 123 | ), |
| 124 | |
| 125 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 126 | __entry->dev = inode->i_sb->s_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 127 | __entry->ino = inode->i_ino; |
| 128 | ), |
| 129 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 130 | TP_printk("dev %d,%d ino %lu", |
| 131 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 132 | (unsigned long) __entry->ino) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 133 | ); |
| 134 | |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 135 | TRACE_EVENT(jbd2_run_stats, |
| 136 | TP_PROTO(dev_t dev, unsigned long tid, |
| 137 | struct transaction_run_stats_s *stats), |
| 138 | |
| 139 | TP_ARGS(dev, tid, stats), |
| 140 | |
| 141 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 142 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 143 | __field( unsigned long, tid ) |
| 144 | __field( unsigned long, wait ) |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame^] | 145 | __field( unsigned long, request_delay ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 146 | __field( unsigned long, running ) |
| 147 | __field( unsigned long, locked ) |
| 148 | __field( unsigned long, flushing ) |
| 149 | __field( unsigned long, logging ) |
| 150 | __field( __u32, handle_count ) |
| 151 | __field( __u32, blocks ) |
| 152 | __field( __u32, blocks_logged ) |
| 153 | ), |
| 154 | |
| 155 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 156 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 157 | __entry->tid = tid; |
| 158 | __entry->wait = stats->rs_wait; |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame^] | 159 | __entry->request_delay = stats->rs_request_delay; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 160 | __entry->running = stats->rs_running; |
| 161 | __entry->locked = stats->rs_locked; |
| 162 | __entry->flushing = stats->rs_flushing; |
| 163 | __entry->logging = stats->rs_logging; |
| 164 | __entry->handle_count = stats->rs_handle_count; |
| 165 | __entry->blocks = stats->rs_blocks; |
| 166 | __entry->blocks_logged = stats->rs_blocks_logged; |
| 167 | ), |
| 168 | |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame^] | 169 | TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " |
| 170 | "locked %u flushing %u logging %u handle_count %u " |
| 171 | "blocks %u blocks_logged %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 172 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 173 | jiffies_to_msecs(__entry->wait), |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame^] | 174 | jiffies_to_msecs(__entry->request_delay), |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 175 | jiffies_to_msecs(__entry->running), |
| 176 | jiffies_to_msecs(__entry->locked), |
| 177 | jiffies_to_msecs(__entry->flushing), |
| 178 | jiffies_to_msecs(__entry->logging), |
| 179 | __entry->handle_count, __entry->blocks, |
| 180 | __entry->blocks_logged) |
| 181 | ); |
| 182 | |
| 183 | TRACE_EVENT(jbd2_checkpoint_stats, |
| 184 | TP_PROTO(dev_t dev, unsigned long tid, |
| 185 | struct transaction_chp_stats_s *stats), |
| 186 | |
| 187 | TP_ARGS(dev, tid, stats), |
| 188 | |
| 189 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 190 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 191 | __field( unsigned long, tid ) |
| 192 | __field( unsigned long, chp_time ) |
| 193 | __field( __u32, forced_to_close ) |
| 194 | __field( __u32, written ) |
| 195 | __field( __u32, dropped ) |
| 196 | ), |
| 197 | |
| 198 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 199 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 200 | __entry->tid = tid; |
| 201 | __entry->chp_time = stats->cs_chp_time; |
| 202 | __entry->forced_to_close= stats->cs_forced_to_close; |
| 203 | __entry->written = stats->cs_written; |
| 204 | __entry->dropped = stats->cs_dropped; |
| 205 | ), |
| 206 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 207 | TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u " |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 208 | "written %u dropped %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 209 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 210 | jiffies_to_msecs(__entry->chp_time), |
| 211 | __entry->forced_to_close, __entry->written, __entry->dropped) |
| 212 | ); |
| 213 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 214 | TRACE_EVENT(jbd2_update_log_tail, |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 215 | |
| 216 | TP_PROTO(journal_t *journal, tid_t first_tid, |
| 217 | unsigned long block_nr, unsigned long freed), |
| 218 | |
| 219 | TP_ARGS(journal, first_tid, block_nr, freed), |
| 220 | |
| 221 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 222 | __field( dev_t, dev ) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 223 | __field( tid_t, tail_sequence ) |
| 224 | __field( tid_t, first_tid ) |
| 225 | __field(unsigned long, block_nr ) |
| 226 | __field(unsigned long, freed ) |
| 227 | ), |
| 228 | |
| 229 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 230 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 231 | __entry->tail_sequence = journal->j_tail_sequence; |
| 232 | __entry->first_tid = first_tid; |
| 233 | __entry->block_nr = block_nr; |
| 234 | __entry->freed = freed; |
| 235 | ), |
| 236 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 237 | TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", |
| 238 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 239 | __entry->tail_sequence, __entry->first_tid, |
| 240 | __entry->block_nr, __entry->freed) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 241 | ); |
| 242 | |
Jan Kara | 24bcc89 | 2012-03-13 15:41:04 -0400 | [diff] [blame] | 243 | TRACE_EVENT(jbd2_write_superblock, |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 244 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 245 | TP_PROTO(journal_t *journal, int write_op), |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 246 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 247 | TP_ARGS(journal, write_op), |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 248 | |
| 249 | TP_STRUCT__entry( |
| 250 | __field( dev_t, dev ) |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 251 | __field( int, write_op ) |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 252 | ), |
| 253 | |
| 254 | TP_fast_assign( |
| 255 | __entry->dev = journal->j_fs_dev->bd_dev; |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 256 | __entry->write_op = write_op; |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 257 | ), |
| 258 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 259 | TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev), |
| 260 | MINOR(__entry->dev), __entry->write_op) |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 261 | ); |
| 262 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 263 | #endif /* _TRACE_JBD2_H */ |
| 264 | |
| 265 | /* This part must be outside protection */ |
| 266 | #include <trace/define_trace.h> |