Skip to content

Commit ee35d2c

Browse files
Kent Overstreetpull[bot]
Kent Overstreet
authored andcommitted
bcachefs: Re-add move_extent_write tracepoint
It appears this was accidentally deleted at some point - also, do a bit of cleanup. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 2531874 commit ee35d2c

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

fs/bcachefs/move.c

+9
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ static void move_write(struct moving_io *io)
111111
return;
112112
}
113113

114+
if (trace_move_extent_write_enabled()) {
115+
struct bch_fs *c = io->write.op.c;
116+
struct printbuf buf = PRINTBUF;
117+
118+
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(io->write.k.k));
119+
trace_move_extent_write(c, buf.buf);
120+
printbuf_exit(&buf);
121+
}
122+
114123
closure_get(&io->write.ctxt->cl);
115124
atomic_add(io->write_sectors, &io->write.ctxt->write_sectors);
116125
atomic_inc(&io->write.ctxt->write_ios);

fs/bcachefs/trace.h

+11-23
Original file line numberDiff line numberDiff line change
@@ -827,40 +827,28 @@ TRACE_EVENT(bucket_evacuate,
827827
);
828828

829829
DEFINE_EVENT(fs_str, move_extent,
830-
TP_PROTO(struct bch_fs *c, const char *k),
831-
TP_ARGS(c, k)
830+
TP_PROTO(struct bch_fs *c, const char *str),
831+
TP_ARGS(c, str)
832832
);
833833

834834
DEFINE_EVENT(fs_str, move_extent_read,
835-
TP_PROTO(struct bch_fs *c, const char *k),
836-
TP_ARGS(c, k)
835+
TP_PROTO(struct bch_fs *c, const char *str),
836+
TP_ARGS(c, str)
837837
);
838838

839839
DEFINE_EVENT(fs_str, move_extent_write,
840-
TP_PROTO(struct bch_fs *c, const char *k),
841-
TP_ARGS(c, k)
840+
TP_PROTO(struct bch_fs *c, const char *str),
841+
TP_ARGS(c, str)
842842
);
843843

844844
DEFINE_EVENT(fs_str, move_extent_finish,
845-
TP_PROTO(struct bch_fs *c, const char *k),
846-
TP_ARGS(c, k)
845+
TP_PROTO(struct bch_fs *c, const char *str),
846+
TP_ARGS(c, str)
847847
);
848848

849-
TRACE_EVENT(move_extent_fail,
850-
TP_PROTO(struct bch_fs *c, const char *msg),
851-
TP_ARGS(c, msg),
852-
853-
TP_STRUCT__entry(
854-
__field(dev_t, dev )
855-
__string(msg, msg )
856-
),
857-
858-
TP_fast_assign(
859-
__entry->dev = c->dev;
860-
__assign_str(msg, msg);
861-
),
862-
863-
TP_printk("%d:%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), __get_str(msg))
849+
DEFINE_EVENT(fs_str, move_extent_fail,
850+
TP_PROTO(struct bch_fs *c, const char *str),
851+
TP_ARGS(c, str)
864852
);
865853

866854
DEFINE_EVENT(fs_str, move_extent_start_fail,

0 commit comments

Comments
 (0)