summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-03 22:13:20 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:30 +0300
commit4254f5bf6e3d62ab7108a556d5afc54188e17041 (patch)
tree95560e41a72608da55edeb806b252c0286107c4b /fs/bcachefs
parentc6b6d416126da015e4b6b6a66b4c6fd3eda40f1f (diff)
downloadlinux-4254f5bf6e3d62ab7108a556d5afc54188e17041.tar.xz
bcachefs: Add a tracepoint for superblock writes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-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,