Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Li Zefan | d0b6e04 | 2009-07-13 10:33:21 +0800 | [diff] [blame] | 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM jbd2 |
| 4 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 5 | #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_JBD2_H |
| 7 | |
| 8 | #include <linux/jbd2.h> |
| 9 | #include <linux/tracepoint.h> |
| 10 | |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 11 | struct transaction_chp_stats_s; |
| 12 | struct transaction_run_stats_s; |
| 13 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 14 | TRACE_EVENT(jbd2_checkpoint, |
| 15 | |
| 16 | TP_PROTO(journal_t *journal, int result), |
| 17 | |
| 18 | TP_ARGS(journal, result), |
| 19 | |
| 20 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 21 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 22 | __field( int, result ) |
| 23 | ), |
| 24 | |
| 25 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 26 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 27 | __entry->result = result; |
| 28 | ), |
| 29 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 30 | TP_printk("dev %d,%d result %d", |
| 31 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 32 | ); |
| 33 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 34 | DECLARE_EVENT_CLASS(jbd2_commit, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 35 | |
| 36 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 37 | |
| 38 | TP_ARGS(journal, commit_transaction), |
| 39 | |
| 40 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 41 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 42 | __field( char, sync_commit ) |
| 43 | __field( int, transaction ) |
| 44 | ), |
| 45 | |
| 46 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 47 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 48 | __entry->sync_commit = commit_transaction->t_synchronous_commit; |
| 49 | __entry->transaction = commit_transaction->t_tid; |
| 50 | ), |
| 51 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 52 | TP_printk("dev %d,%d transaction %d sync %d", |
| 53 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 54 | __entry->transaction, __entry->sync_commit) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 55 | ); |
| 56 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 57 | DEFINE_EVENT(jbd2_commit, jbd2_start_commit, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 58 | |
| 59 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 60 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 61 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 62 | ); |
| 63 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 64 | DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 65 | |
| 66 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 67 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 68 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 69 | ); |
| 70 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 71 | DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 72 | |
| 73 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 74 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 75 | TP_ARGS(journal, commit_transaction) |
| 76 | ); |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 77 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 78 | DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 79 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 80 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 81 | |
Li Zefan | 071688f | 2009-11-26 15:06:55 +0800 | [diff] [blame] | 82 | TP_ARGS(journal, commit_transaction) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 83 | ); |
| 84 | |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 85 | DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction, |
| 86 | |
| 87 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 88 | |
| 89 | TP_ARGS(journal, commit_transaction) |
| 90 | ); |
| 91 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 92 | TRACE_EVENT(jbd2_end_commit, |
| 93 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
| 94 | |
| 95 | TP_ARGS(journal, commit_transaction), |
| 96 | |
| 97 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 98 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 99 | __field( char, sync_commit ) |
| 100 | __field( int, transaction ) |
| 101 | __field( int, head ) |
| 102 | ), |
| 103 | |
| 104 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 105 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 106 | __entry->sync_commit = commit_transaction->t_synchronous_commit; |
| 107 | __entry->transaction = commit_transaction->t_tid; |
| 108 | __entry->head = journal->j_tail_sequence; |
| 109 | ), |
| 110 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 111 | TP_printk("dev %d,%d transaction %d sync %d head %d", |
| 112 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 113 | __entry->transaction, __entry->sync_commit, __entry->head) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 114 | ); |
| 115 | |
| 116 | TRACE_EVENT(jbd2_submit_inode_data, |
| 117 | TP_PROTO(struct inode *inode), |
| 118 | |
| 119 | TP_ARGS(inode), |
| 120 | |
| 121 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 122 | __field( dev_t, dev ) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 123 | __field( ino_t, ino ) |
| 124 | ), |
| 125 | |
| 126 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 127 | __entry->dev = inode->i_sb->s_dev; |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 128 | __entry->ino = inode->i_ino; |
| 129 | ), |
| 130 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 131 | TP_printk("dev %d,%d ino %lu", |
| 132 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 133 | (unsigned long) __entry->ino) |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 134 | ); |
| 135 | |
Jan Kara | 0094f98 | 2019-11-05 17:44:30 +0100 | [diff] [blame] | 136 | DECLARE_EVENT_CLASS(jbd2_handle_start_class, |
Theodore Ts'o | 343d9c2 | 2013-02-08 13:00:22 -0500 | [diff] [blame] | 137 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, |
| 138 | unsigned int line_no, int requested_blocks), |
| 139 | |
| 140 | TP_ARGS(dev, tid, type, line_no, requested_blocks), |
| 141 | |
| 142 | TP_STRUCT__entry( |
| 143 | __field( dev_t, dev ) |
| 144 | __field( unsigned long, tid ) |
| 145 | __field( unsigned int, type ) |
| 146 | __field( unsigned int, line_no ) |
| 147 | __field( int, requested_blocks) |
| 148 | ), |
| 149 | |
| 150 | TP_fast_assign( |
| 151 | __entry->dev = dev; |
| 152 | __entry->tid = tid; |
| 153 | __entry->type = type; |
| 154 | __entry->line_no = line_no; |
| 155 | __entry->requested_blocks = requested_blocks; |
| 156 | ), |
| 157 | |
| 158 | TP_printk("dev %d,%d tid %lu type %u line_no %u " |
| 159 | "requested_blocks %d", |
| 160 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
| 161 | __entry->type, __entry->line_no, __entry->requested_blocks) |
| 162 | ); |
| 163 | |
Jan Kara | 0094f98 | 2019-11-05 17:44:30 +0100 | [diff] [blame] | 164 | DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_start, |
| 165 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, |
| 166 | unsigned int line_no, int requested_blocks), |
| 167 | |
| 168 | TP_ARGS(dev, tid, type, line_no, requested_blocks) |
| 169 | ); |
| 170 | |
| 171 | DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_restart, |
| 172 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, |
| 173 | unsigned int line_no, int requested_blocks), |
| 174 | |
| 175 | TP_ARGS(dev, tid, type, line_no, requested_blocks) |
| 176 | ); |
| 177 | |
Theodore Ts'o | 343d9c2 | 2013-02-08 13:00:22 -0500 | [diff] [blame] | 178 | TRACE_EVENT(jbd2_handle_extend, |
| 179 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, |
| 180 | unsigned int line_no, int buffer_credits, |
| 181 | int requested_blocks), |
| 182 | |
| 183 | TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), |
| 184 | |
| 185 | TP_STRUCT__entry( |
| 186 | __field( dev_t, dev ) |
| 187 | __field( unsigned long, tid ) |
| 188 | __field( unsigned int, type ) |
| 189 | __field( unsigned int, line_no ) |
| 190 | __field( int, buffer_credits ) |
| 191 | __field( int, requested_blocks) |
| 192 | ), |
| 193 | |
| 194 | TP_fast_assign( |
| 195 | __entry->dev = dev; |
| 196 | __entry->tid = tid; |
| 197 | __entry->type = type; |
| 198 | __entry->line_no = line_no; |
| 199 | __entry->buffer_credits = buffer_credits; |
| 200 | __entry->requested_blocks = requested_blocks; |
| 201 | ), |
| 202 | |
| 203 | TP_printk("dev %d,%d tid %lu type %u line_no %u " |
| 204 | "buffer_credits %d requested_blocks %d", |
| 205 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
| 206 | __entry->type, __entry->line_no, __entry->buffer_credits, |
| 207 | __entry->requested_blocks) |
| 208 | ); |
| 209 | |
| 210 | TRACE_EVENT(jbd2_handle_stats, |
| 211 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, |
| 212 | unsigned int line_no, int interval, int sync, |
| 213 | int requested_blocks, int dirtied_blocks), |
| 214 | |
| 215 | TP_ARGS(dev, tid, type, line_no, interval, sync, |
| 216 | requested_blocks, dirtied_blocks), |
| 217 | |
| 218 | TP_STRUCT__entry( |
| 219 | __field( dev_t, dev ) |
| 220 | __field( unsigned long, tid ) |
| 221 | __field( unsigned int, type ) |
| 222 | __field( unsigned int, line_no ) |
| 223 | __field( int, interval ) |
| 224 | __field( int, sync ) |
| 225 | __field( int, requested_blocks) |
| 226 | __field( int, dirtied_blocks ) |
| 227 | ), |
| 228 | |
| 229 | TP_fast_assign( |
| 230 | __entry->dev = dev; |
| 231 | __entry->tid = tid; |
| 232 | __entry->type = type; |
| 233 | __entry->line_no = line_no; |
| 234 | __entry->interval = interval; |
| 235 | __entry->sync = sync; |
| 236 | __entry->requested_blocks = requested_blocks; |
| 237 | __entry->dirtied_blocks = dirtied_blocks; |
| 238 | ), |
| 239 | |
| 240 | TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d " |
| 241 | "sync %d requested_blocks %d dirtied_blocks %d", |
| 242 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
| 243 | __entry->type, __entry->line_no, __entry->interval, |
| 244 | __entry->sync, __entry->requested_blocks, |
| 245 | __entry->dirtied_blocks) |
| 246 | ); |
| 247 | |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 248 | TRACE_EVENT(jbd2_run_stats, |
| 249 | TP_PROTO(dev_t dev, unsigned long tid, |
| 250 | struct transaction_run_stats_s *stats), |
| 251 | |
| 252 | TP_ARGS(dev, tid, stats), |
| 253 | |
| 254 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 255 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 256 | __field( unsigned long, tid ) |
| 257 | __field( unsigned long, wait ) |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame] | 258 | __field( unsigned long, request_delay ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 259 | __field( unsigned long, running ) |
| 260 | __field( unsigned long, locked ) |
| 261 | __field( unsigned long, flushing ) |
| 262 | __field( unsigned long, logging ) |
| 263 | __field( __u32, handle_count ) |
| 264 | __field( __u32, blocks ) |
| 265 | __field( __u32, blocks_logged ) |
| 266 | ), |
| 267 | |
| 268 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 269 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 270 | __entry->tid = tid; |
| 271 | __entry->wait = stats->rs_wait; |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame] | 272 | __entry->request_delay = stats->rs_request_delay; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 273 | __entry->running = stats->rs_running; |
| 274 | __entry->locked = stats->rs_locked; |
| 275 | __entry->flushing = stats->rs_flushing; |
| 276 | __entry->logging = stats->rs_logging; |
| 277 | __entry->handle_count = stats->rs_handle_count; |
| 278 | __entry->blocks = stats->rs_blocks; |
| 279 | __entry->blocks_logged = stats->rs_blocks_logged; |
| 280 | ), |
| 281 | |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame] | 282 | TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " |
| 283 | "locked %u flushing %u logging %u handle_count %u " |
| 284 | "blocks %u blocks_logged %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 285 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 286 | jiffies_to_msecs(__entry->wait), |
Theodore Ts'o | 9fff24a | 2013-02-06 22:30:23 -0500 | [diff] [blame] | 287 | jiffies_to_msecs(__entry->request_delay), |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 288 | jiffies_to_msecs(__entry->running), |
| 289 | jiffies_to_msecs(__entry->locked), |
| 290 | jiffies_to_msecs(__entry->flushing), |
| 291 | jiffies_to_msecs(__entry->logging), |
| 292 | __entry->handle_count, __entry->blocks, |
| 293 | __entry->blocks_logged) |
| 294 | ); |
| 295 | |
| 296 | TRACE_EVENT(jbd2_checkpoint_stats, |
| 297 | TP_PROTO(dev_t dev, unsigned long tid, |
| 298 | struct transaction_chp_stats_s *stats), |
| 299 | |
| 300 | TP_ARGS(dev, tid, stats), |
| 301 | |
| 302 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 303 | __field( dev_t, dev ) |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 304 | __field( unsigned long, tid ) |
| 305 | __field( unsigned long, chp_time ) |
| 306 | __field( __u32, forced_to_close ) |
| 307 | __field( __u32, written ) |
| 308 | __field( __u32, dropped ) |
| 309 | ), |
| 310 | |
| 311 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 312 | __entry->dev = dev; |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 313 | __entry->tid = tid; |
| 314 | __entry->chp_time = stats->cs_chp_time; |
| 315 | __entry->forced_to_close= stats->cs_forced_to_close; |
| 316 | __entry->written = stats->cs_written; |
| 317 | __entry->dropped = stats->cs_dropped; |
| 318 | ), |
| 319 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 320 | 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] | 321 | "written %u dropped %u", |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 322 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
Theodore Ts'o | bf69932 | 2009-09-30 00:32:06 -0400 | [diff] [blame] | 323 | jiffies_to_msecs(__entry->chp_time), |
| 324 | __entry->forced_to_close, __entry->written, __entry->dropped) |
| 325 | ); |
| 326 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 327 | TRACE_EVENT(jbd2_update_log_tail, |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 328 | |
| 329 | TP_PROTO(journal_t *journal, tid_t first_tid, |
| 330 | unsigned long block_nr, unsigned long freed), |
| 331 | |
| 332 | TP_ARGS(journal, first_tid, block_nr, freed), |
| 333 | |
| 334 | TP_STRUCT__entry( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 335 | __field( dev_t, dev ) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 336 | __field( tid_t, tail_sequence ) |
| 337 | __field( tid_t, first_tid ) |
| 338 | __field(unsigned long, block_nr ) |
| 339 | __field(unsigned long, freed ) |
| 340 | ), |
| 341 | |
| 342 | TP_fast_assign( |
Jiaying Zhang | 0562e0b | 2011-03-21 21:38:05 -0400 | [diff] [blame] | 343 | __entry->dev = journal->j_fs_dev->bd_dev; |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 344 | __entry->tail_sequence = journal->j_tail_sequence; |
| 345 | __entry->first_tid = first_tid; |
| 346 | __entry->block_nr = block_nr; |
| 347 | __entry->freed = freed; |
| 348 | ), |
| 349 | |
Theodore Ts'o | 4862fd6 | 2011-07-10 22:05:08 -0400 | [diff] [blame] | 350 | TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", |
| 351 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 352 | __entry->tail_sequence, __entry->first_tid, |
| 353 | __entry->block_nr, __entry->freed) |
Theodore Ts'o | 71f2be2 | 2009-12-23 07:45:44 -0500 | [diff] [blame] | 354 | ); |
| 355 | |
Jan Kara | 24bcc89 | 2012-03-13 15:41:04 -0400 | [diff] [blame] | 356 | TRACE_EVENT(jbd2_write_superblock, |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 357 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 358 | TP_PROTO(journal_t *journal, int write_op), |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 359 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 360 | TP_ARGS(journal, write_op), |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 361 | |
| 362 | TP_STRUCT__entry( |
| 363 | __field( dev_t, dev ) |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 364 | __field( int, write_op ) |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 365 | ), |
| 366 | |
| 367 | TP_fast_assign( |
| 368 | __entry->dev = journal->j_fs_dev->bd_dev; |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 369 | __entry->write_op = write_op; |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 370 | ), |
| 371 | |
Jan Kara | 79feb52 | 2012-03-13 22:22:54 -0400 | [diff] [blame] | 372 | TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev), |
| 373 | MINOR(__entry->dev), __entry->write_op) |
Seiji Aguchi | 2201c59 | 2012-02-20 17:53:01 -0500 | [diff] [blame] | 374 | ); |
| 375 | |
Theodore Ts'o | f783f09 | 2013-04-21 16:47:54 -0400 | [diff] [blame] | 376 | TRACE_EVENT(jbd2_lock_buffer_stall, |
| 377 | |
| 378 | TP_PROTO(dev_t dev, unsigned long stall_ms), |
| 379 | |
| 380 | TP_ARGS(dev, stall_ms), |
| 381 | |
| 382 | TP_STRUCT__entry( |
| 383 | __field( dev_t, dev ) |
| 384 | __field(unsigned long, stall_ms ) |
| 385 | ), |
| 386 | |
| 387 | TP_fast_assign( |
| 388 | __entry->dev = dev; |
| 389 | __entry->stall_ms = stall_ms; |
| 390 | ), |
| 391 | |
| 392 | TP_printk("dev %d,%d stall_ms %lu", |
| 393 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 394 | __entry->stall_ms) |
| 395 | ); |
| 396 | |
Zhang Yi | 4ba3fcd | 2021-06-10 19:24:37 +0800 | [diff] [blame] | 397 | DECLARE_EVENT_CLASS(jbd2_journal_shrink, |
| 398 | |
| 399 | TP_PROTO(journal_t *journal, unsigned long nr_to_scan, |
| 400 | unsigned long count), |
| 401 | |
| 402 | TP_ARGS(journal, nr_to_scan, count), |
| 403 | |
| 404 | TP_STRUCT__entry( |
| 405 | __field(dev_t, dev) |
| 406 | __field(unsigned long, nr_to_scan) |
| 407 | __field(unsigned long, count) |
| 408 | ), |
| 409 | |
| 410 | TP_fast_assign( |
| 411 | __entry->dev = journal->j_fs_dev->bd_dev; |
| 412 | __entry->nr_to_scan = nr_to_scan; |
| 413 | __entry->count = count; |
| 414 | ), |
| 415 | |
| 416 | TP_printk("dev %d,%d nr_to_scan %lu count %lu", |
| 417 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 418 | __entry->nr_to_scan, __entry->count) |
| 419 | ); |
| 420 | |
| 421 | DEFINE_EVENT(jbd2_journal_shrink, jbd2_shrink_count, |
| 422 | |
| 423 | TP_PROTO(journal_t *journal, unsigned long nr_to_scan, unsigned long count), |
| 424 | |
| 425 | TP_ARGS(journal, nr_to_scan, count) |
| 426 | ); |
| 427 | |
| 428 | DEFINE_EVENT(jbd2_journal_shrink, jbd2_shrink_scan_enter, |
| 429 | |
| 430 | TP_PROTO(journal_t *journal, unsigned long nr_to_scan, unsigned long count), |
| 431 | |
| 432 | TP_ARGS(journal, nr_to_scan, count) |
| 433 | ); |
| 434 | |
| 435 | TRACE_EVENT(jbd2_shrink_scan_exit, |
| 436 | |
| 437 | TP_PROTO(journal_t *journal, unsigned long nr_to_scan, |
| 438 | unsigned long nr_shrunk, unsigned long count), |
| 439 | |
| 440 | TP_ARGS(journal, nr_to_scan, nr_shrunk, count), |
| 441 | |
| 442 | TP_STRUCT__entry( |
| 443 | __field(dev_t, dev) |
| 444 | __field(unsigned long, nr_to_scan) |
| 445 | __field(unsigned long, nr_shrunk) |
| 446 | __field(unsigned long, count) |
| 447 | ), |
| 448 | |
| 449 | TP_fast_assign( |
| 450 | __entry->dev = journal->j_fs_dev->bd_dev; |
| 451 | __entry->nr_to_scan = nr_to_scan; |
| 452 | __entry->nr_shrunk = nr_shrunk; |
| 453 | __entry->count = count; |
| 454 | ), |
| 455 | |
| 456 | TP_printk("dev %d,%d nr_to_scan %lu nr_shrunk %lu count %lu", |
| 457 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 458 | __entry->nr_to_scan, __entry->nr_shrunk, |
| 459 | __entry->count) |
| 460 | ); |
| 461 | |
| 462 | TRACE_EVENT(jbd2_shrink_checkpoint_list, |
| 463 | |
| 464 | TP_PROTO(journal_t *journal, tid_t first_tid, tid_t tid, tid_t last_tid, |
| 465 | unsigned long nr_freed, unsigned long nr_scanned, |
| 466 | tid_t next_tid), |
| 467 | |
| 468 | TP_ARGS(journal, first_tid, tid, last_tid, nr_freed, |
| 469 | nr_scanned, next_tid), |
| 470 | |
| 471 | TP_STRUCT__entry( |
| 472 | __field(dev_t, dev) |
| 473 | __field(tid_t, first_tid) |
| 474 | __field(tid_t, tid) |
| 475 | __field(tid_t, last_tid) |
| 476 | __field(unsigned long, nr_freed) |
| 477 | __field(unsigned long, nr_scanned) |
| 478 | __field(tid_t, next_tid) |
| 479 | ), |
| 480 | |
| 481 | TP_fast_assign( |
| 482 | __entry->dev = journal->j_fs_dev->bd_dev; |
| 483 | __entry->first_tid = first_tid; |
| 484 | __entry->tid = tid; |
| 485 | __entry->last_tid = last_tid; |
| 486 | __entry->nr_freed = nr_freed; |
| 487 | __entry->nr_scanned = nr_scanned; |
| 488 | __entry->next_tid = next_tid; |
| 489 | ), |
| 490 | |
| 491 | TP_printk("dev %d,%d shrink transaction %u-%u(%u) freed %lu " |
| 492 | "scanned %lu next transaction %u", |
| 493 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 494 | __entry->first_tid, __entry->tid, __entry->last_tid, |
| 495 | __entry->nr_freed, __entry->nr_scanned, __entry->next_tid) |
| 496 | ); |
| 497 | |
Theodore Ts'o | 879c5e6 | 2009-06-17 11:47:48 -0400 | [diff] [blame] | 498 | #endif /* _TRACE_JBD2_H */ |
| 499 | |
| 500 | /* This part must be outside protection */ |
| 501 | #include <trace/define_trace.h> |