mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 16:24:29 -04:00
bcachefs: trace_stripe_create
Add a simple tracepoint for stripe creation, we'll want to expand this later. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -1486,6 +1486,7 @@ static void ec_stripe_create(struct ec_stripe_new *s)
|
||||
if (s->err) {
|
||||
if (!bch2_err_matches(s->err, EROFS))
|
||||
bch_err(c, "error creating stripe: error writing data buckets");
|
||||
ret = s->err;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1494,6 +1495,7 @@ static void ec_stripe_create(struct ec_stripe_new *s)
|
||||
|
||||
if (ec_do_recov(c, &s->existing_stripe)) {
|
||||
bch_err(c, "error creating stripe: error reading existing stripe");
|
||||
ret = -BCH_ERR_ec_block_read;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1519,6 +1521,7 @@ static void ec_stripe_create(struct ec_stripe_new *s)
|
||||
|
||||
if (ec_nr_failed(&s->new_stripe)) {
|
||||
bch_err(c, "error creating stripe: error writing redundancy buckets");
|
||||
ret = -BCH_ERR_ec_block_write;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1540,6 +1543,8 @@ static void ec_stripe_create(struct ec_stripe_new *s)
|
||||
if (ret)
|
||||
goto err;
|
||||
err:
|
||||
trace_stripe_create(c, s->idx, ret);
|
||||
|
||||
bch2_disk_reservation_put(c, &s->res);
|
||||
|
||||
for (i = 0; i < v->nr_blocks; i++)
|
||||
|
||||
@@ -280,6 +280,8 @@
|
||||
x(EIO, insufficient_journal_devices) \
|
||||
x(EIO, device_offline) \
|
||||
x(EIO, EIO_fault_injected) \
|
||||
x(EIO, ec_block_read) \
|
||||
x(EIO, ec_block_write) \
|
||||
x(BCH_ERR_btree_node_read_err, btree_node_read_err_fixable) \
|
||||
x(BCH_ERR_btree_node_read_err, btree_node_read_err_want_retry) \
|
||||
x(BCH_ERR_btree_node_read_err, btree_node_read_err_must_retry) \
|
||||
|
||||
@@ -339,6 +339,30 @@ DEFINE_EVENT(bio, io_read_reuse_race,
|
||||
TP_ARGS(bio)
|
||||
);
|
||||
|
||||
/* ec.c */
|
||||
|
||||
TRACE_EVENT(stripe_create,
|
||||
TP_PROTO(struct bch_fs *c, u64 idx, int ret),
|
||||
TP_ARGS(c, idx, ret),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(dev_t, dev )
|
||||
__field(u64, idx )
|
||||
__field(int, ret )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->dev = c->dev;
|
||||
__entry->idx = idx;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
|
||||
TP_printk("%d,%d idx %llu ret %i",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->idx,
|
||||
__entry->ret)
|
||||
);
|
||||
|
||||
/* Journal */
|
||||
|
||||
DEFINE_EVENT(bch_fs, journal_full,
|
||||
|
||||
Reference in New Issue
Block a user