]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcachefs: Re-add move_extent_write tracepoint
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 15 Jan 2024 20:04:40 +0000 (15:04 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 21 Jan 2024 18:27:09 +0000 (13:27 -0500)
It appears this was accidentally deleted at some point - also, do a bit
of cleanup.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/move.c
fs/bcachefs/trace.h

index a9e0920b34f32122f1d3e65220f8237ab09acfdf..7a66706e4dcef67b60892c7bc95021d0a3e7a657 100644 (file)
@@ -111,6 +111,15 @@ static void move_write(struct moving_io *io)
                return;
        }
 
+       if (trace_move_extent_write_enabled()) {
+               struct bch_fs *c = io->write.op.c;
+               struct printbuf buf = PRINTBUF;
+
+               bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(io->write.k.k));
+               trace_move_extent_write(c, buf.buf);
+               printbuf_exit(&buf);
+       }
+
        closure_get(&io->write.ctxt->cl);
        atomic_add(io->write_sectors, &io->write.ctxt->write_sectors);
        atomic_inc(&io->write.ctxt->write_ios);
index c94876b3bb06e4d8bf0ba490421ead37d87e5569..8292efc3289ba3b52a2b0ea276926e6b19e24323 100644 (file)
@@ -827,40 +827,28 @@ TRACE_EVENT(bucket_evacuate,
 );
 
 DEFINE_EVENT(fs_str, move_extent,
-       TP_PROTO(struct bch_fs *c, const char *k),
-       TP_ARGS(c, k)
+       TP_PROTO(struct bch_fs *c, const char *str),
+       TP_ARGS(c, str)
 );
 
 DEFINE_EVENT(fs_str, move_extent_read,
-       TP_PROTO(struct bch_fs *c, const char *k),
-       TP_ARGS(c, k)
+       TP_PROTO(struct bch_fs *c, const char *str),
+       TP_ARGS(c, str)
 );
 
 DEFINE_EVENT(fs_str, move_extent_write,
-       TP_PROTO(struct bch_fs *c, const char *k),
-       TP_ARGS(c, k)
+       TP_PROTO(struct bch_fs *c, const char *str),
+       TP_ARGS(c, str)
 );
 
 DEFINE_EVENT(fs_str, move_extent_finish,
-       TP_PROTO(struct bch_fs *c, const char *k),
-       TP_ARGS(c, k)
+       TP_PROTO(struct bch_fs *c, const char *str),
+       TP_ARGS(c, str)
 );
 
-TRACE_EVENT(move_extent_fail,
-       TP_PROTO(struct bch_fs *c, const char *msg),
-       TP_ARGS(c, msg),
-
-       TP_STRUCT__entry(
-               __field(dev_t,          dev                     )
-               __string(msg,           msg                     )
-       ),
-
-       TP_fast_assign(
-               __entry->dev            = c->dev;
-               __assign_str(msg, msg);
-       ),
-
-       TP_printk("%d:%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), __get_str(msg))
+DEFINE_EVENT(fs_str, move_extent_fail,
+       TP_PROTO(struct bch_fs *c, const char *str),
+       TP_ARGS(c, str)
 );
 
 DEFINE_EVENT(fs_str, move_extent_start_fail,