Skip to content

Commit 1270639

Browse files
committed
ext4: add tracepoint for ext4_journal_start
This will help debug who is responsible for starting a jbd2 transaction. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 4862fd6 commit 1270639

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
269269
journal_t *journal;
270270
handle_t *handle;
271271

272+
trace_ext4_journal_start(sb, nblocks, _RET_IP_);
272273
if (sb->s_flags & MS_RDONLY)
273274
return ERR_PTR(-EROFS);
274275

‎include/trace/events/ext4.h‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,28 @@ TRACE_EVENT(ext4_load_inode,
15201520
(unsigned long) __entry->ino)
15211521
);
15221522

1523+
TRACE_EVENT(ext4_journal_start,
1524+
TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1525+
1526+
TP_ARGS(sb, nblocks, IP),
1527+
1528+
TP_STRUCT__entry(
1529+
__field( dev_t, dev )
1530+
__field( int, nblocks )
1531+
__field(unsigned long, ip )
1532+
),
1533+
1534+
TP_fast_assign(
1535+
__entry->dev = sb->s_dev;
1536+
__entry->nblocks = nblocks;
1537+
__entry->ip = IP;
1538+
),
1539+
1540+
TP_printk("dev %d,%d nblocks %d caller %pF",
1541+
MAJOR(__entry->dev), MINOR(__entry->dev),
1542+
__entry->nblocks, (void *)__entry->ip)
1543+
);
1544+
15231545
#endif /* _TRACE_EXT4_H */
15241546

15251547
/* This part must be outside protection */

0 commit comments

Comments
 (0)