aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/bcachefs/super-io.c3
-rw-r--r--fs/bcachefs/trace.h20
2 files changed, 23 insertions, 0 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 4fb2bede39f6..7e885b51349e 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -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;
diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h
index ef2096fd147d..eeacb5291764 100644
--- a/fs/bcachefs/trace.h
+++ b/fs/bcachefs/trace.h
@@ -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,