]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Add a tracepoint for superblock writes
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 3 Apr 2022 19:13:20 +0000 (15:13 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:30 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super-io.c
fs/bcachefs/trace.h

index 4fb2bede39f65b10ab1d838e04af11452e38ed6c..7e885b51349e09c8126ce2078f58efc18d8a318b 100644 (file)
@@ -16,6 +16,7 @@
 #include "quota.h"
 #include "super-io.h"
 #include "super.h"
+#include "trace.h"
 #include "vstructs.h"
 
 #include <linux/backing-dev.h>
@@ -799,6 +800,8 @@ int bch2_write_super(struct bch_fs *c)
        unsigned degraded_flags = BCH_FORCE_IF_DEGRADED;
        int ret = 0;
 
+       trace_write_super(c, _RET_IP_);
+
        if (c->opts.very_degraded)
                degraded_flags |= BCH_FORCE_IF_LOST;
 
index ef2096fd147d97429bbb341eefd5d2fd459e32d4..eeacb5291764de174e3396aeeea08d8533bb1e0b 100644 (file)
@@ -82,6 +82,26 @@ DECLARE_EVENT_CLASS(bio,
                  (unsigned long long)__entry->sector, __entry->nr_sector)
 );
 
+/* super-io.c: */
+TRACE_EVENT(write_super,
+       TP_PROTO(struct bch_fs *c, unsigned long ip),
+       TP_ARGS(c, ip),
+
+       TP_STRUCT__entry(
+               __field(dev_t,          dev     )
+               __field(unsigned long,  ip      )
+       ),
+
+       TP_fast_assign(
+               __entry->dev            = c->dev;
+               __entry->ip             = ip;
+       ),
+
+       TP_printk("%d,%d for %pS",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 (void *) __entry->ip)
+);
+
 /* io.c: */
 
 DEFINE_EVENT(bio, read_split,