Skip to content

Commit ae4d612

Browse files
author
Kent Overstreet
committed
bcachefs: trace_move_extent_start_fail() now includes errcode
Renamed from trace_move_extent_alloc_mem_fail, because there are other reasons we colud fail (disk space allocation failure). Signed-off-by: Kent Overstreet <[email protected]>
1 parent 5510a4a commit ae4d612

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ struct bch_sb_field_disk_groups {
15321532
x(move_extent_write, 36) \
15331533
x(move_extent_finish, 37) \
15341534
x(move_extent_fail, 38) \
1535-
x(move_extent_alloc_mem_fail, 39) \
1535+
x(move_extent_start_fail, 39) \
15361536
x(copygc, 40) \
15371537
x(copygc_wait, 41) \
15381538
x(gc_gens_end, 42) \

fs/bcachefs/move.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,6 @@ static void trace_move_extent_read2(struct bch_fs *c, struct bkey_s_c k)
4949
}
5050
}
5151

52-
static void trace_move_extent_alloc_mem_fail2(struct bch_fs *c, struct bkey_s_c k)
53-
{
54-
if (trace_move_extent_alloc_mem_fail_enabled()) {
55-
struct printbuf buf = PRINTBUF;
56-
57-
bch2_bkey_val_to_text(&buf, c, k);
58-
trace_move_extent_alloc_mem_fail(c, buf.buf);
59-
printbuf_exit(&buf);
60-
}
61-
}
62-
6352
struct moving_io {
6453
struct list_head read_list;
6554
struct list_head io_list;
@@ -349,8 +338,16 @@ int bch2_move_extent(struct moving_context *ctxt,
349338
if (ret == -BCH_ERR_data_update_done)
350339
return 0;
351340

352-
this_cpu_inc(c->counters[BCH_COUNTER_move_extent_alloc_mem_fail]);
353-
trace_move_extent_alloc_mem_fail2(c, k);
341+
this_cpu_inc(c->counters[BCH_COUNTER_move_extent_start_fail]);
342+
if (trace_move_extent_start_fail_enabled()) {
343+
struct printbuf buf = PRINTBUF;
344+
345+
bch2_bkey_val_to_text(&buf, c, k);
346+
prt_str(&buf, ": ");
347+
prt_str(&buf, bch2_err_str(ret));
348+
trace_move_extent_start_fail(c, buf.buf);
349+
printbuf_exit(&buf);
350+
}
354351
return ret;
355352
}
356353

fs/bcachefs/trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ TRACE_EVENT(move_extent_fail,
754754
TP_printk("%d:%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), __get_str(msg))
755755
);
756756

757-
DEFINE_EVENT(bkey, move_extent_alloc_mem_fail,
758-
TP_PROTO(struct bch_fs *c, const char *k),
759-
TP_ARGS(c, k)
757+
DEFINE_EVENT(bkey, move_extent_start_fail,
758+
TP_PROTO(struct bch_fs *c, const char *str),
759+
TP_ARGS(c, str)
760760
);
761761

762762
TRACE_EVENT(move_data,

0 commit comments

Comments
 (0)