1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2d0b6e04aSLi Zefan #undef TRACE_SYSTEM 3d0b6e04aSLi Zefan #define TRACE_SYSTEM jbd2 4d0b6e04aSLi Zefan 5879c5e6bSTheodore Ts'o #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) 6879c5e6bSTheodore Ts'o #define _TRACE_JBD2_H 7879c5e6bSTheodore Ts'o 8879c5e6bSTheodore Ts'o #include <linux/jbd2.h> 9879c5e6bSTheodore Ts'o #include <linux/tracepoint.h> 10879c5e6bSTheodore Ts'o 11bf699327STheodore Ts'o struct transaction_chp_stats_s; 12bf699327STheodore Ts'o struct transaction_run_stats_s; 13bf699327STheodore Ts'o 14879c5e6bSTheodore Ts'o TRACE_EVENT(jbd2_checkpoint, 15879c5e6bSTheodore Ts'o 16879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, int result), 17879c5e6bSTheodore Ts'o 18879c5e6bSTheodore Ts'o TP_ARGS(journal, result), 19879c5e6bSTheodore Ts'o 20879c5e6bSTheodore Ts'o TP_STRUCT__entry( 210562e0baSJiaying Zhang __field( dev_t, dev ) 22879c5e6bSTheodore Ts'o __field( int, result ) 23879c5e6bSTheodore Ts'o ), 24879c5e6bSTheodore Ts'o 25879c5e6bSTheodore Ts'o TP_fast_assign( 260562e0baSJiaying Zhang __entry->dev = journal->j_fs_dev->bd_dev; 27879c5e6bSTheodore Ts'o __entry->result = result; 28879c5e6bSTheodore Ts'o ), 29879c5e6bSTheodore Ts'o 304862fd60STheodore Ts'o TP_printk("dev %d,%d result %d", 314862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result) 32879c5e6bSTheodore Ts'o ); 33879c5e6bSTheodore Ts'o 34071688f3SLi Zefan DECLARE_EVENT_CLASS(jbd2_commit, 35879c5e6bSTheodore Ts'o 36879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 37879c5e6bSTheodore Ts'o 38879c5e6bSTheodore Ts'o TP_ARGS(journal, commit_transaction), 39879c5e6bSTheodore Ts'o 40879c5e6bSTheodore Ts'o TP_STRUCT__entry( 410562e0baSJiaying Zhang __field( dev_t, dev ) 42879c5e6bSTheodore Ts'o __field( char, sync_commit ) 43879c5e6bSTheodore Ts'o __field( int, transaction ) 44879c5e6bSTheodore Ts'o ), 45879c5e6bSTheodore Ts'o 46879c5e6bSTheodore Ts'o TP_fast_assign( 470562e0baSJiaying Zhang __entry->dev = journal->j_fs_dev->bd_dev; 48879c5e6bSTheodore Ts'o __entry->sync_commit = commit_transaction->t_synchronous_commit; 49879c5e6bSTheodore Ts'o __entry->transaction = commit_transaction->t_tid; 50879c5e6bSTheodore Ts'o ), 51879c5e6bSTheodore Ts'o 524862fd60STheodore Ts'o TP_printk("dev %d,%d transaction %d sync %d", 534862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), 544862fd60STheodore Ts'o __entry->transaction, __entry->sync_commit) 55879c5e6bSTheodore Ts'o ); 56879c5e6bSTheodore Ts'o 57071688f3SLi Zefan DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 58879c5e6bSTheodore Ts'o 59879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 60879c5e6bSTheodore Ts'o 61071688f3SLi Zefan TP_ARGS(journal, commit_transaction) 62879c5e6bSTheodore Ts'o ); 63879c5e6bSTheodore Ts'o 64071688f3SLi Zefan DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, 65879c5e6bSTheodore Ts'o 66879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 67879c5e6bSTheodore Ts'o 68071688f3SLi Zefan TP_ARGS(journal, commit_transaction) 69879c5e6bSTheodore Ts'o ); 70879c5e6bSTheodore Ts'o 71071688f3SLi Zefan DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, 72879c5e6bSTheodore Ts'o 73879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 74879c5e6bSTheodore Ts'o 75071688f3SLi Zefan TP_ARGS(journal, commit_transaction) 76071688f3SLi Zefan ); 77879c5e6bSTheodore Ts'o 78071688f3SLi Zefan DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, 79879c5e6bSTheodore Ts'o 80071688f3SLi Zefan TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 81879c5e6bSTheodore Ts'o 82071688f3SLi Zefan TP_ARGS(journal, commit_transaction) 83879c5e6bSTheodore Ts'o ); 84879c5e6bSTheodore Ts'o 852201c590SSeiji Aguchi DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction, 862201c590SSeiji Aguchi 872201c590SSeiji Aguchi TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 882201c590SSeiji Aguchi 892201c590SSeiji Aguchi TP_ARGS(journal, commit_transaction) 902201c590SSeiji Aguchi ); 912201c590SSeiji Aguchi 92879c5e6bSTheodore Ts'o TRACE_EVENT(jbd2_end_commit, 93879c5e6bSTheodore Ts'o TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 94879c5e6bSTheodore Ts'o 95879c5e6bSTheodore Ts'o TP_ARGS(journal, commit_transaction), 96879c5e6bSTheodore Ts'o 97879c5e6bSTheodore Ts'o TP_STRUCT__entry( 980562e0baSJiaying Zhang __field( dev_t, dev ) 99879c5e6bSTheodore Ts'o __field( char, sync_commit ) 100879c5e6bSTheodore Ts'o __field( int, transaction ) 101879c5e6bSTheodore Ts'o __field( int, head ) 102879c5e6bSTheodore Ts'o ), 103879c5e6bSTheodore Ts'o 104879c5e6bSTheodore Ts'o TP_fast_assign( 1050562e0baSJiaying Zhang __entry->dev = journal->j_fs_dev->bd_dev; 106879c5e6bSTheodore Ts'o __entry->sync_commit = commit_transaction->t_synchronous_commit; 107879c5e6bSTheodore Ts'o __entry->transaction = commit_transaction->t_tid; 108879c5e6bSTheodore Ts'o __entry->head = journal->j_tail_sequence; 109879c5e6bSTheodore Ts'o ), 110879c5e6bSTheodore Ts'o 1114862fd60STheodore Ts'o TP_printk("dev %d,%d transaction %d sync %d head %d", 1124862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), 1134862fd60STheodore Ts'o __entry->transaction, __entry->sync_commit, __entry->head) 114879c5e6bSTheodore Ts'o ); 115879c5e6bSTheodore Ts'o 116879c5e6bSTheodore Ts'o TRACE_EVENT(jbd2_submit_inode_data, 117879c5e6bSTheodore Ts'o TP_PROTO(struct inode *inode), 118879c5e6bSTheodore Ts'o 119879c5e6bSTheodore Ts'o TP_ARGS(inode), 120879c5e6bSTheodore Ts'o 121879c5e6bSTheodore Ts'o TP_STRUCT__entry( 1220562e0baSJiaying Zhang __field( dev_t, dev ) 123879c5e6bSTheodore Ts'o __field( ino_t, ino ) 124879c5e6bSTheodore Ts'o ), 125879c5e6bSTheodore Ts'o 126879c5e6bSTheodore Ts'o TP_fast_assign( 1270562e0baSJiaying Zhang __entry->dev = inode->i_sb->s_dev; 128879c5e6bSTheodore Ts'o __entry->ino = inode->i_ino; 129879c5e6bSTheodore Ts'o ), 130879c5e6bSTheodore Ts'o 1314862fd60STheodore Ts'o TP_printk("dev %d,%d ino %lu", 1324862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), 1334862fd60STheodore Ts'o (unsigned long) __entry->ino) 134879c5e6bSTheodore Ts'o ); 135879c5e6bSTheodore Ts'o 1360094f981SJan Kara DECLARE_EVENT_CLASS(jbd2_handle_start_class, 137343d9c28STheodore Ts'o TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, 138343d9c28STheodore Ts'o unsigned int line_no, int requested_blocks), 139343d9c28STheodore Ts'o 140343d9c28STheodore Ts'o TP_ARGS(dev, tid, type, line_no, requested_blocks), 141343d9c28STheodore Ts'o 142343d9c28STheodore Ts'o TP_STRUCT__entry( 143343d9c28STheodore Ts'o __field( dev_t, dev ) 144343d9c28STheodore Ts'o __field( unsigned long, tid ) 145343d9c28STheodore Ts'o __field( unsigned int, type ) 146343d9c28STheodore Ts'o __field( unsigned int, line_no ) 147343d9c28STheodore Ts'o __field( int, requested_blocks) 148343d9c28STheodore Ts'o ), 149343d9c28STheodore Ts'o 150343d9c28STheodore Ts'o TP_fast_assign( 151343d9c28STheodore Ts'o __entry->dev = dev; 152343d9c28STheodore Ts'o __entry->tid = tid; 153343d9c28STheodore Ts'o __entry->type = type; 154343d9c28STheodore Ts'o __entry->line_no = line_no; 155343d9c28STheodore Ts'o __entry->requested_blocks = requested_blocks; 156343d9c28STheodore Ts'o ), 157343d9c28STheodore Ts'o 158343d9c28STheodore Ts'o TP_printk("dev %d,%d tid %lu type %u line_no %u " 159343d9c28STheodore Ts'o "requested_blocks %d", 160343d9c28STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, 161343d9c28STheodore Ts'o __entry->type, __entry->line_no, __entry->requested_blocks) 162343d9c28STheodore Ts'o ); 163343d9c28STheodore Ts'o 1640094f981SJan Kara DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_start, 1650094f981SJan Kara TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, 1660094f981SJan Kara unsigned int line_no, int requested_blocks), 1670094f981SJan Kara 1680094f981SJan Kara TP_ARGS(dev, tid, type, line_no, requested_blocks) 1690094f981SJan Kara ); 1700094f981SJan Kara 1710094f981SJan Kara DEFINE_EVENT(jbd2_handle_start_class, jbd2_handle_restart, 1720094f981SJan Kara TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, 1730094f981SJan Kara unsigned int line_no, int requested_blocks), 1740094f981SJan Kara 1750094f981SJan Kara TP_ARGS(dev, tid, type, line_no, requested_blocks) 1760094f981SJan Kara ); 1770094f981SJan Kara 178343d9c28STheodore Ts'o TRACE_EVENT(jbd2_handle_extend, 179343d9c28STheodore Ts'o TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, 180343d9c28STheodore Ts'o unsigned int line_no, int buffer_credits, 181343d9c28STheodore Ts'o int requested_blocks), 182343d9c28STheodore Ts'o 183343d9c28STheodore Ts'o TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), 184343d9c28STheodore Ts'o 185343d9c28STheodore Ts'o TP_STRUCT__entry( 186343d9c28STheodore Ts'o __field( dev_t, dev ) 187343d9c28STheodore Ts'o __field( unsigned long, tid ) 188343d9c28STheodore Ts'o __field( unsigned int, type ) 189343d9c28STheodore Ts'o __field( unsigned int, line_no ) 190343d9c28STheodore Ts'o __field( int, buffer_credits ) 191343d9c28STheodore Ts'o __field( int, requested_blocks) 192343d9c28STheodore Ts'o ), 193343d9c28STheodore Ts'o 194343d9c28STheodore Ts'o TP_fast_assign( 195343d9c28STheodore Ts'o __entry->dev = dev; 196343d9c28STheodore Ts'o __entry->tid = tid; 197343d9c28STheodore Ts'o __entry->type = type; 198343d9c28STheodore Ts'o __entry->line_no = line_no; 199343d9c28STheodore Ts'o __entry->buffer_credits = buffer_credits; 200343d9c28STheodore Ts'o __entry->requested_blocks = requested_blocks; 201343d9c28STheodore Ts'o ), 202343d9c28STheodore Ts'o 203343d9c28STheodore Ts'o TP_printk("dev %d,%d tid %lu type %u line_no %u " 204343d9c28STheodore Ts'o "buffer_credits %d requested_blocks %d", 205343d9c28STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, 206343d9c28STheodore Ts'o __entry->type, __entry->line_no, __entry->buffer_credits, 207343d9c28STheodore Ts'o __entry->requested_blocks) 208343d9c28STheodore Ts'o ); 209343d9c28STheodore Ts'o 210343d9c28STheodore Ts'o TRACE_EVENT(jbd2_handle_stats, 211343d9c28STheodore Ts'o TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, 212343d9c28STheodore Ts'o unsigned int line_no, int interval, int sync, 213343d9c28STheodore Ts'o int requested_blocks, int dirtied_blocks), 214343d9c28STheodore Ts'o 215343d9c28STheodore Ts'o TP_ARGS(dev, tid, type, line_no, interval, sync, 216343d9c28STheodore Ts'o requested_blocks, dirtied_blocks), 217343d9c28STheodore Ts'o 218343d9c28STheodore Ts'o TP_STRUCT__entry( 219343d9c28STheodore Ts'o __field( dev_t, dev ) 220343d9c28STheodore Ts'o __field( unsigned long, tid ) 221343d9c28STheodore Ts'o __field( unsigned int, type ) 222343d9c28STheodore Ts'o __field( unsigned int, line_no ) 223343d9c28STheodore Ts'o __field( int, interval ) 224343d9c28STheodore Ts'o __field( int, sync ) 225343d9c28STheodore Ts'o __field( int, requested_blocks) 226343d9c28STheodore Ts'o __field( int, dirtied_blocks ) 227343d9c28STheodore Ts'o ), 228343d9c28STheodore Ts'o 229343d9c28STheodore Ts'o TP_fast_assign( 230343d9c28STheodore Ts'o __entry->dev = dev; 231343d9c28STheodore Ts'o __entry->tid = tid; 232343d9c28STheodore Ts'o __entry->type = type; 233343d9c28STheodore Ts'o __entry->line_no = line_no; 234343d9c28STheodore Ts'o __entry->interval = interval; 235343d9c28STheodore Ts'o __entry->sync = sync; 236343d9c28STheodore Ts'o __entry->requested_blocks = requested_blocks; 237343d9c28STheodore Ts'o __entry->dirtied_blocks = dirtied_blocks; 238343d9c28STheodore Ts'o ), 239343d9c28STheodore Ts'o 240343d9c28STheodore Ts'o TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d " 241343d9c28STheodore Ts'o "sync %d requested_blocks %d dirtied_blocks %d", 242343d9c28STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, 243343d9c28STheodore Ts'o __entry->type, __entry->line_no, __entry->interval, 244343d9c28STheodore Ts'o __entry->sync, __entry->requested_blocks, 245343d9c28STheodore Ts'o __entry->dirtied_blocks) 246343d9c28STheodore Ts'o ); 247343d9c28STheodore Ts'o 248bf699327STheodore Ts'o TRACE_EVENT(jbd2_run_stats, 249bf699327STheodore Ts'o TP_PROTO(dev_t dev, unsigned long tid, 250bf699327STheodore Ts'o struct transaction_run_stats_s *stats), 251bf699327STheodore Ts'o 252bf699327STheodore Ts'o TP_ARGS(dev, tid, stats), 253bf699327STheodore Ts'o 254bf699327STheodore Ts'o TP_STRUCT__entry( 2550562e0baSJiaying Zhang __field( dev_t, dev ) 256bf699327STheodore Ts'o __field( unsigned long, tid ) 257bf699327STheodore Ts'o __field( unsigned long, wait ) 2589fff24aaSTheodore Ts'o __field( unsigned long, request_delay ) 259bf699327STheodore Ts'o __field( unsigned long, running ) 260bf699327STheodore Ts'o __field( unsigned long, locked ) 261bf699327STheodore Ts'o __field( unsigned long, flushing ) 262bf699327STheodore Ts'o __field( unsigned long, logging ) 263bf699327STheodore Ts'o __field( __u32, handle_count ) 264bf699327STheodore Ts'o __field( __u32, blocks ) 265bf699327STheodore Ts'o __field( __u32, blocks_logged ) 266bf699327STheodore Ts'o ), 267bf699327STheodore Ts'o 268bf699327STheodore Ts'o TP_fast_assign( 2690562e0baSJiaying Zhang __entry->dev = dev; 270bf699327STheodore Ts'o __entry->tid = tid; 271bf699327STheodore Ts'o __entry->wait = stats->rs_wait; 2729fff24aaSTheodore Ts'o __entry->request_delay = stats->rs_request_delay; 273bf699327STheodore Ts'o __entry->running = stats->rs_running; 274bf699327STheodore Ts'o __entry->locked = stats->rs_locked; 275bf699327STheodore Ts'o __entry->flushing = stats->rs_flushing; 276bf699327STheodore Ts'o __entry->logging = stats->rs_logging; 277bf699327STheodore Ts'o __entry->handle_count = stats->rs_handle_count; 278bf699327STheodore Ts'o __entry->blocks = stats->rs_blocks; 279bf699327STheodore Ts'o __entry->blocks_logged = stats->rs_blocks_logged; 280bf699327STheodore Ts'o ), 281bf699327STheodore Ts'o 2829fff24aaSTheodore Ts'o TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " 2839fff24aaSTheodore Ts'o "locked %u flushing %u logging %u handle_count %u " 2849fff24aaSTheodore Ts'o "blocks %u blocks_logged %u", 2854862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, 286bf699327STheodore Ts'o jiffies_to_msecs(__entry->wait), 2879fff24aaSTheodore Ts'o jiffies_to_msecs(__entry->request_delay), 288bf699327STheodore Ts'o jiffies_to_msecs(__entry->running), 289bf699327STheodore Ts'o jiffies_to_msecs(__entry->locked), 290bf699327STheodore Ts'o jiffies_to_msecs(__entry->flushing), 291bf699327STheodore Ts'o jiffies_to_msecs(__entry->logging), 292bf699327STheodore Ts'o __entry->handle_count, __entry->blocks, 293bf699327STheodore Ts'o __entry->blocks_logged) 294bf699327STheodore Ts'o ); 295bf699327STheodore Ts'o 296bf699327STheodore Ts'o TRACE_EVENT(jbd2_checkpoint_stats, 297bf699327STheodore Ts'o TP_PROTO(dev_t dev, unsigned long tid, 298bf699327STheodore Ts'o struct transaction_chp_stats_s *stats), 299bf699327STheodore Ts'o 300bf699327STheodore Ts'o TP_ARGS(dev, tid, stats), 301bf699327STheodore Ts'o 302bf699327STheodore Ts'o TP_STRUCT__entry( 3030562e0baSJiaying Zhang __field( dev_t, dev ) 304bf699327STheodore Ts'o __field( unsigned long, tid ) 305bf699327STheodore Ts'o __field( unsigned long, chp_time ) 306bf699327STheodore Ts'o __field( __u32, forced_to_close ) 307bf699327STheodore Ts'o __field( __u32, written ) 308bf699327STheodore Ts'o __field( __u32, dropped ) 309bf699327STheodore Ts'o ), 310bf699327STheodore Ts'o 311bf699327STheodore Ts'o TP_fast_assign( 3120562e0baSJiaying Zhang __entry->dev = dev; 313bf699327STheodore Ts'o __entry->tid = tid; 314bf699327STheodore Ts'o __entry->chp_time = stats->cs_chp_time; 315bf699327STheodore Ts'o __entry->forced_to_close= stats->cs_forced_to_close; 316bf699327STheodore Ts'o __entry->written = stats->cs_written; 317bf699327STheodore Ts'o __entry->dropped = stats->cs_dropped; 318bf699327STheodore Ts'o ), 319bf699327STheodore Ts'o 3204862fd60STheodore Ts'o TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u " 321bf699327STheodore Ts'o "written %u dropped %u", 3224862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, 323bf699327STheodore Ts'o jiffies_to_msecs(__entry->chp_time), 324bf699327STheodore Ts'o __entry->forced_to_close, __entry->written, __entry->dropped) 325bf699327STheodore Ts'o ); 326bf699327STheodore Ts'o 32779feb521SJan Kara TRACE_EVENT(jbd2_update_log_tail, 32871f2be21STheodore Ts'o 32971f2be21STheodore Ts'o TP_PROTO(journal_t *journal, tid_t first_tid, 33071f2be21STheodore Ts'o unsigned long block_nr, unsigned long freed), 33171f2be21STheodore Ts'o 33271f2be21STheodore Ts'o TP_ARGS(journal, first_tid, block_nr, freed), 33371f2be21STheodore Ts'o 33471f2be21STheodore Ts'o TP_STRUCT__entry( 3350562e0baSJiaying Zhang __field( dev_t, dev ) 33671f2be21STheodore Ts'o __field( tid_t, tail_sequence ) 33771f2be21STheodore Ts'o __field( tid_t, first_tid ) 33871f2be21STheodore Ts'o __field(unsigned long, block_nr ) 33971f2be21STheodore Ts'o __field(unsigned long, freed ) 34071f2be21STheodore Ts'o ), 34171f2be21STheodore Ts'o 34271f2be21STheodore Ts'o TP_fast_assign( 3430562e0baSJiaying Zhang __entry->dev = journal->j_fs_dev->bd_dev; 34471f2be21STheodore Ts'o __entry->tail_sequence = journal->j_tail_sequence; 34571f2be21STheodore Ts'o __entry->first_tid = first_tid; 34671f2be21STheodore Ts'o __entry->block_nr = block_nr; 34771f2be21STheodore Ts'o __entry->freed = freed; 34871f2be21STheodore Ts'o ), 34971f2be21STheodore Ts'o 3504862fd60STheodore Ts'o TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", 3514862fd60STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), 3524862fd60STheodore Ts'o __entry->tail_sequence, __entry->first_tid, 3534862fd60STheodore Ts'o __entry->block_nr, __entry->freed) 35471f2be21STheodore Ts'o ); 35571f2be21STheodore Ts'o 35624bcc89cSJan Kara TRACE_EVENT(jbd2_write_superblock, 3572201c590SSeiji Aguchi 35879feb521SJan Kara TP_PROTO(journal_t *journal, int write_op), 3592201c590SSeiji Aguchi 36079feb521SJan Kara TP_ARGS(journal, write_op), 3612201c590SSeiji Aguchi 3622201c590SSeiji Aguchi TP_STRUCT__entry( 3632201c590SSeiji Aguchi __field( dev_t, dev ) 36479feb521SJan Kara __field( int, write_op ) 3652201c590SSeiji Aguchi ), 3662201c590SSeiji Aguchi 3672201c590SSeiji Aguchi TP_fast_assign( 3682201c590SSeiji Aguchi __entry->dev = journal->j_fs_dev->bd_dev; 36979feb521SJan Kara __entry->write_op = write_op; 3702201c590SSeiji Aguchi ), 3712201c590SSeiji Aguchi 37279feb521SJan Kara TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev), 37379feb521SJan Kara MINOR(__entry->dev), __entry->write_op) 3742201c590SSeiji Aguchi ); 3752201c590SSeiji Aguchi 376f783f091STheodore Ts'o TRACE_EVENT(jbd2_lock_buffer_stall, 377f783f091STheodore Ts'o 378f783f091STheodore Ts'o TP_PROTO(dev_t dev, unsigned long stall_ms), 379f783f091STheodore Ts'o 380f783f091STheodore Ts'o TP_ARGS(dev, stall_ms), 381f783f091STheodore Ts'o 382f783f091STheodore Ts'o TP_STRUCT__entry( 383f783f091STheodore Ts'o __field( dev_t, dev ) 384f783f091STheodore Ts'o __field(unsigned long, stall_ms ) 385f783f091STheodore Ts'o ), 386f783f091STheodore Ts'o 387f783f091STheodore Ts'o TP_fast_assign( 388f783f091STheodore Ts'o __entry->dev = dev; 389f783f091STheodore Ts'o __entry->stall_ms = stall_ms; 390f783f091STheodore Ts'o ), 391f783f091STheodore Ts'o 392f783f091STheodore Ts'o TP_printk("dev %d,%d stall_ms %lu", 393f783f091STheodore Ts'o MAJOR(__entry->dev), MINOR(__entry->dev), 394f783f091STheodore Ts'o __entry->stall_ms) 395f783f091STheodore Ts'o ); 396f783f091STheodore Ts'o 397*4ba3fcddSZhang Yi DECLARE_EVENT_CLASS(jbd2_journal_shrink, 398*4ba3fcddSZhang Yi 399*4ba3fcddSZhang Yi TP_PROTO(journal_t *journal, unsigned long nr_to_scan, 400*4ba3fcddSZhang Yi unsigned long count), 401*4ba3fcddSZhang Yi 402*4ba3fcddSZhang Yi TP_ARGS(journal, nr_to_scan, count), 403*4ba3fcddSZhang Yi 404*4ba3fcddSZhang Yi TP_STRUCT__entry( 405*4ba3fcddSZhang Yi __field(dev_t, dev) 406*4ba3fcddSZhang Yi __field(unsigned long, nr_to_scan) 407*4ba3fcddSZhang Yi __field(unsigned long, count) 408*4ba3fcddSZhang Yi ), 409*4ba3fcddSZhang Yi 410*4ba3fcddSZhang Yi TP_fast_assign( 411*4ba3fcddSZhang Yi __entry->dev = journal->j_fs_dev->bd_dev; 412*4ba3fcddSZhang Yi __entry->nr_to_scan = nr_to_scan; 413*4ba3fcddSZhang Yi __entry->count = count; 414*4ba3fcddSZhang Yi ), 415*4ba3fcddSZhang Yi 416*4ba3fcddSZhang Yi TP_printk("dev %d,%d nr_to_scan %lu count %lu", 417*4ba3fcddSZhang Yi MAJOR(__entry->dev), MINOR(__entry->dev), 418*4ba3fcddSZhang Yi __entry->nr_to_scan, __entry->count) 419*4ba3fcddSZhang Yi ); 420*4ba3fcddSZhang Yi 421*4ba3fcddSZhang Yi DEFINE_EVENT(jbd2_journal_shrink, jbd2_shrink_count, 422*4ba3fcddSZhang Yi 423*4ba3fcddSZhang Yi TP_PROTO(journal_t *journal, unsigned long nr_to_scan, unsigned long count), 424*4ba3fcddSZhang Yi 425*4ba3fcddSZhang Yi TP_ARGS(journal, nr_to_scan, count) 426*4ba3fcddSZhang Yi ); 427*4ba3fcddSZhang Yi 428*4ba3fcddSZhang Yi DEFINE_EVENT(jbd2_journal_shrink, jbd2_shrink_scan_enter, 429*4ba3fcddSZhang Yi 430*4ba3fcddSZhang Yi TP_PROTO(journal_t *journal, unsigned long nr_to_scan, unsigned long count), 431*4ba3fcddSZhang Yi 432*4ba3fcddSZhang Yi TP_ARGS(journal, nr_to_scan, count) 433*4ba3fcddSZhang Yi ); 434*4ba3fcddSZhang Yi 435*4ba3fcddSZhang Yi TRACE_EVENT(jbd2_shrink_scan_exit, 436*4ba3fcddSZhang Yi 437*4ba3fcddSZhang Yi TP_PROTO(journal_t *journal, unsigned long nr_to_scan, 438*4ba3fcddSZhang Yi unsigned long nr_shrunk, unsigned long count), 439*4ba3fcddSZhang Yi 440*4ba3fcddSZhang Yi TP_ARGS(journal, nr_to_scan, nr_shrunk, count), 441*4ba3fcddSZhang Yi 442*4ba3fcddSZhang Yi TP_STRUCT__entry( 443*4ba3fcddSZhang Yi __field(dev_t, dev) 444*4ba3fcddSZhang Yi __field(unsigned long, nr_to_scan) 445*4ba3fcddSZhang Yi __field(unsigned long, nr_shrunk) 446*4ba3fcddSZhang Yi __field(unsigned long, count) 447*4ba3fcddSZhang Yi ), 448*4ba3fcddSZhang Yi 449*4ba3fcddSZhang Yi TP_fast_assign( 450*4ba3fcddSZhang Yi __entry->dev = journal->j_fs_dev->bd_dev; 451*4ba3fcddSZhang Yi __entry->nr_to_scan = nr_to_scan; 452*4ba3fcddSZhang Yi __entry->nr_shrunk = nr_shrunk; 453*4ba3fcddSZhang Yi __entry->count = count; 454*4ba3fcddSZhang Yi ), 455*4ba3fcddSZhang Yi 456*4ba3fcddSZhang Yi TP_printk("dev %d,%d nr_to_scan %lu nr_shrunk %lu count %lu", 457*4ba3fcddSZhang Yi MAJOR(__entry->dev), MINOR(__entry->dev), 458*4ba3fcddSZhang Yi __entry->nr_to_scan, __entry->nr_shrunk, 459*4ba3fcddSZhang Yi __entry->count) 460*4ba3fcddSZhang Yi ); 461*4ba3fcddSZhang Yi 462*4ba3fcddSZhang Yi TRACE_EVENT(jbd2_shrink_checkpoint_list, 463*4ba3fcddSZhang Yi 464*4ba3fcddSZhang Yi TP_PROTO(journal_t *journal, tid_t first_tid, tid_t tid, tid_t last_tid, 465*4ba3fcddSZhang Yi unsigned long nr_freed, unsigned long nr_scanned, 466*4ba3fcddSZhang Yi tid_t next_tid), 467*4ba3fcddSZhang Yi 468*4ba3fcddSZhang Yi TP_ARGS(journal, first_tid, tid, last_tid, nr_freed, 469*4ba3fcddSZhang Yi nr_scanned, next_tid), 470*4ba3fcddSZhang Yi 471*4ba3fcddSZhang Yi TP_STRUCT__entry( 472*4ba3fcddSZhang Yi __field(dev_t, dev) 473*4ba3fcddSZhang Yi __field(tid_t, first_tid) 474*4ba3fcddSZhang Yi __field(tid_t, tid) 475*4ba3fcddSZhang Yi __field(tid_t, last_tid) 476*4ba3fcddSZhang Yi __field(unsigned long, nr_freed) 477*4ba3fcddSZhang Yi __field(unsigned long, nr_scanned) 478*4ba3fcddSZhang Yi __field(tid_t, next_tid) 479*4ba3fcddSZhang Yi ), 480*4ba3fcddSZhang Yi 481*4ba3fcddSZhang Yi TP_fast_assign( 482*4ba3fcddSZhang Yi __entry->dev = journal->j_fs_dev->bd_dev; 483*4ba3fcddSZhang Yi __entry->first_tid = first_tid; 484*4ba3fcddSZhang Yi __entry->tid = tid; 485*4ba3fcddSZhang Yi __entry->last_tid = last_tid; 486*4ba3fcddSZhang Yi __entry->nr_freed = nr_freed; 487*4ba3fcddSZhang Yi __entry->nr_scanned = nr_scanned; 488*4ba3fcddSZhang Yi __entry->next_tid = next_tid; 489*4ba3fcddSZhang Yi ), 490*4ba3fcddSZhang Yi 491*4ba3fcddSZhang Yi TP_printk("dev %d,%d shrink transaction %u-%u(%u) freed %lu " 492*4ba3fcddSZhang Yi "scanned %lu next transaction %u", 493*4ba3fcddSZhang Yi MAJOR(__entry->dev), MINOR(__entry->dev), 494*4ba3fcddSZhang Yi __entry->first_tid, __entry->tid, __entry->last_tid, 495*4ba3fcddSZhang Yi __entry->nr_freed, __entry->nr_scanned, __entry->next_tid) 496*4ba3fcddSZhang Yi ); 497*4ba3fcddSZhang Yi 498879c5e6bSTheodore Ts'o #endif /* _TRACE_JBD2_H */ 499879c5e6bSTheodore Ts'o 500879c5e6bSTheodore Ts'o /* This part must be outside protection */ 501879c5e6bSTheodore Ts'o #include <trace/define_trace.h> 502