diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-17 04:41:10 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 19:47:37 +0300 |
commit | ae0e61175e22b77267c2c59d0061925a0a604074 (patch) | |
tree | 9fc6df97d1128d351abfb803ffb5657ba1236f48 /fs | |
parent | b27d7afb791715f4017f94c58168676c76398986 (diff) | |
download | linux-ae0e61175e22b77267c2c59d0061925a0a604074.tar.xz |
bcachefs: Add a tracepoint for journal entry close
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/journal.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/trace.h | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 63fb115da157..fb983061af4a 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -184,6 +184,8 @@ static void __journal_entry_close(struct journal *j, unsigned closed_val) /* Close out old buffer: */ buf->data->u64s = cpu_to_le32(old.cur_entry_offset); + trace_journal_entry_close(c, vstruct_bytes(buf->data)); + sectors = vstruct_blocks_plus(buf->data, c->block_bits, buf->u64s_reserved) << c->block_bits; BUG_ON(sectors > buf->sectors); diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h index f663f21b07f3..52db4df67c3a 100644 --- a/fs/bcachefs/trace.h +++ b/fs/bcachefs/trace.h @@ -188,6 +188,25 @@ DEFINE_EVENT(bch_fs, journal_entry_full, TP_ARGS(c) ); +TRACE_EVENT(journal_entry_close, + TP_PROTO(struct bch_fs *c, unsigned bytes), + TP_ARGS(c, bytes), + + TP_STRUCT__entry( + __field(dev_t, dev ) + __field(u32, bytes ) + ), + + TP_fast_assign( + __entry->dev = c->dev; + __entry->bytes = bytes; + ), + + TP_printk("%d,%d entry bytes %u", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->bytes) +); + DEFINE_EVENT(bio, journal_write, TP_PROTO(struct bio *bio), TP_ARGS(bio) |