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 | |
| 84 | TRACE_EVENT(jbd2_end_commit, |
| 85 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 86 | |
| 87 | TP_ARGS(journal, commit_transaction), |
| 88 | |
| 89 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 90 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 91 | __field( char, sync_commit ) |
| 92 | __field( int, transaction ) |
| 93 | __field( int, head ) |
| 94 | ), |
| 95 | |
| 96 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 97 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 98 | __entry->sync_commit = commit_transaction->t_synchronous_commit; |
| 99 | __entry->transaction = commit_transaction->t_tid; |
| 100 | __entry->head = journal->j_tail_sequence; |
| 101 | ), |
| 102 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 103 | TP_printk("dev %d,%d transaction %d sync %d head %d", |
| 104 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 105 | __entry->transaction, __entry->sync_commit, __entry->head) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 106 | ); |
| 107 | |
| 108 | TRACE_EVENT(jbd2_submit_inode_data, |
| 109 | TP_PROTO(struct inode *inode), |
| 110 | |
| 111 | TP_ARGS(inode), |
| 112 | |
| 113 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 114 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 115 | __field( ino_t, ino ) |
| 116 | ), |
| 117 | |
| 118 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 119 | __entry->dev = inode->i_sb->s_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 120 | __entry->ino = inode->i_ino; |
| 121 | ), |
| 122 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 123 | TP_printk("dev %d,%d ino %lu", |
| 124 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 125 | (unsigned long) __entry->ino) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 126 | ); |
| 127 | |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 128 | TRACE_EVENT(jbd2_run_stats, |
| 129 | TP_PROTO(dev_t dev, unsigned long tid, |
| 130 | struct transaction_run_stats_s *stats), |
| 131 | |
| 132 | TP_ARGS(dev, tid, stats), |
| 133 | |
| 134 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 135 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 136 | __field( unsigned long, tid ) |
| 137 | __field( unsigned long, wait ) |
| 138 | __field( unsigned long, running ) |
| 139 | __field( unsigned long, locked ) |
| 140 | __field( unsigned long, flushing ) |
| 141 | __field( unsigned long, logging ) |
| 142 | __field( __u32, handle_count ) |
| 143 | __field( __u32, blocks ) |
| 144 | __field( __u32, blocks_logged ) |
| 145 | ), |
| 146 | |
| 147 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 148 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 149 | __entry->tid = tid; |
| 150 | __entry->wait = stats->rs_wait; |
| 151 | __entry->running = stats->rs_running; |
| 152 | __entry->locked = stats->rs_locked; |
| 153 | __entry->flushing = stats->rs_flushing; |
| 154 | __entry->logging = stats->rs_logging; |
| 155 | __entry->handle_count = stats->rs_handle_count; |
| 156 | __entry->blocks = stats->rs_blocks; |
| 157 | __entry->blocks_logged = stats->rs_blocks_logged; |
| 158 | ), |
| 159 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 160 | TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u " |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 161 | "logging %u handle_count %u blocks %u blocks_logged %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 162 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 163 | jiffies_to_msecs(__entry->wait), |
| 164 | jiffies_to_msecs(__entry->running), |
| 165 | jiffies_to_msecs(__entry->locked), |
| 166 | jiffies_to_msecs(__entry->flushing), |
| 167 | jiffies_to_msecs(__entry->logging), |
| 168 | __entry->handle_count, __entry->blocks, |
| 169 | __entry->blocks_logged) |
| 170 | ); |
| 171 | |
| 172 | TRACE_EVENT(jbd2_checkpoint_stats, |
| 173 | TP_PROTO(dev_t dev, unsigned long tid, |
| 174 | struct transaction_chp_stats_s *stats), |
| 175 | |
| 176 | TP_ARGS(dev, tid, stats), |
| 177 | |
| 178 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 179 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 180 | __field( unsigned long, tid ) |
| 181 | __field( unsigned long, chp_time ) |
| 182 | __field( __u32, forced_to_close ) |
| 183 | __field( __u32, written ) |
| 184 | __field( __u32, dropped ) |
| 185 | ), |
| 186 | |
| 187 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 188 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 189 | __entry->tid = tid; |
| 190 | __entry->chp_time = stats->cs_chp_time; |
| 191 | __entry->forced_to_close= stats->cs_forced_to_close; |
| 192 | __entry->written = stats->cs_written; |
| 193 | __entry->dropped = stats->cs_dropped; |
| 194 | ), |
| 195 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 196 | 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] | 197 | "written %u dropped %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 198 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 199 | jiffies_to_msecs(__entry->chp_time), |
| 200 | __entry->forced_to_close, __entry->written, __entry->dropped) |
| 201 | ); |
| 202 | |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 203 | TRACE_EVENT(jbd2_cleanup_journal_tail, |
| 204 | |
| 205 | TP_PROTO(journal_t *journal, tid_t first_tid, |
| 206 | unsigned long block_nr, unsigned long freed), |
| 207 | |
| 208 | TP_ARGS(journal, first_tid, block_nr, freed), |
| 209 | |
| 210 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 211 | __field( dev_t, dev ) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 212 | __field( tid_t, tail_sequence ) |
| 213 | __field( tid_t, first_tid ) |
| 214 | __field(unsigned long, block_nr ) |
| 215 | __field(unsigned long, freed ) |
| 216 | ), |
| 217 | |
| 218 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 219 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 220 | __entry->tail_sequence = journal->j_tail_sequence; |
| 221 | __entry->first_tid = first_tid; |
| 222 | __entry->block_nr = block_nr; |
| 223 | __entry->freed = freed; |
| 224 | ), |
| 225 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 226 | TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", |
| 227 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 228 | __entry->tail_sequence, __entry->first_tid, |
| 229 | __entry->block_nr, __entry->freed) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 230 | ); |
| 231 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 232 | #endif /* _TRACE_JBD2_H */ |
| 233 | |
| 234 | /* This part must be outside protection */ |
| 235 | #include <trace/define_trace.h> |