@@ -1234,6 +1234,8 @@ struct bch_sb_field {
1234
1234
x(ext, 13) \
1235
1235
x(downgrade, 14)
1236
1236
1237
+ #include "sb-counters_format.h"
1238
+
1237
1239
enum bch_sb_field_type {
1238
1240
#define x(f, nr) BCH_SB_FIELD_##f = nr,
1239
1241
BCH_SB_FIELDS ()
@@ -1504,101 +1506,6 @@ struct bch_sb_field_disk_groups {
1504
1506
struct bch_disk_group entries [];
1505
1507
} __packed __aligned (8 );
1506
1508
1507
- /* BCH_SB_FIELD_counters */
1508
-
1509
- #define BCH_PERSISTENT_COUNTERS () \
1510
- x(io_read, 0) \
1511
- x(io_write, 1) \
1512
- x(io_move, 2) \
1513
- x(bucket_invalidate, 3) \
1514
- x(bucket_discard, 4) \
1515
- x(bucket_alloc, 5) \
1516
- x(bucket_alloc_fail, 6) \
1517
- x(btree_cache_scan, 7) \
1518
- x(btree_cache_reap, 8) \
1519
- x(btree_cache_cannibalize, 9) \
1520
- x(btree_cache_cannibalize_lock, 10) \
1521
- x(btree_cache_cannibalize_lock_fail, 11) \
1522
- x(btree_cache_cannibalize_unlock, 12) \
1523
- x(btree_node_write, 13) \
1524
- x(btree_node_read, 14) \
1525
- x(btree_node_compact, 15) \
1526
- x(btree_node_merge, 16) \
1527
- x(btree_node_split, 17) \
1528
- x(btree_node_rewrite, 18) \
1529
- x(btree_node_alloc, 19) \
1530
- x(btree_node_free, 20) \
1531
- x(btree_node_set_root, 21) \
1532
- x(btree_path_relock_fail, 22) \
1533
- x(btree_path_upgrade_fail, 23) \
1534
- x(btree_reserve_get_fail, 24) \
1535
- x(journal_entry_full, 25) \
1536
- x(journal_full, 26) \
1537
- x(journal_reclaim_finish, 27) \
1538
- x(journal_reclaim_start, 28) \
1539
- x(journal_write, 29) \
1540
- x(read_promote, 30) \
1541
- x(read_bounce, 31) \
1542
- x(read_split, 33) \
1543
- x(read_retry, 32) \
1544
- x(read_reuse_race, 34) \
1545
- x(move_extent_read, 35) \
1546
- x(move_extent_write, 36) \
1547
- x(move_extent_finish, 37) \
1548
- x(move_extent_fail, 38) \
1549
- x(move_extent_start_fail, 39) \
1550
- x(copygc, 40) \
1551
- x(copygc_wait, 41) \
1552
- x(gc_gens_end, 42) \
1553
- x(gc_gens_start, 43) \
1554
- x(trans_blocked_journal_reclaim, 44) \
1555
- x(trans_restart_btree_node_reused, 45) \
1556
- x(trans_restart_btree_node_split, 46) \
1557
- x(trans_restart_fault_inject, 47) \
1558
- x(trans_restart_iter_upgrade, 48) \
1559
- x(trans_restart_journal_preres_get, 49) \
1560
- x(trans_restart_journal_reclaim, 50) \
1561
- x(trans_restart_journal_res_get, 51) \
1562
- x(trans_restart_key_cache_key_realloced, 52) \
1563
- x(trans_restart_key_cache_raced, 53) \
1564
- x(trans_restart_mark_replicas, 54) \
1565
- x(trans_restart_mem_realloced, 55) \
1566
- x(trans_restart_memory_allocation_failure, 56) \
1567
- x(trans_restart_relock, 57) \
1568
- x(trans_restart_relock_after_fill, 58) \
1569
- x(trans_restart_relock_key_cache_fill, 59) \
1570
- x(trans_restart_relock_next_node, 60) \
1571
- x(trans_restart_relock_parent_for_fill, 61) \
1572
- x(trans_restart_relock_path, 62) \
1573
- x(trans_restart_relock_path_intent, 63) \
1574
- x(trans_restart_too_many_iters, 64) \
1575
- x(trans_restart_traverse, 65) \
1576
- x(trans_restart_upgrade, 66) \
1577
- x(trans_restart_would_deadlock, 67) \
1578
- x(trans_restart_would_deadlock_write, 68) \
1579
- x(trans_restart_injected, 69) \
1580
- x(trans_restart_key_cache_upgrade, 70) \
1581
- x(trans_traverse_all, 71) \
1582
- x(transaction_commit, 72) \
1583
- x(write_super, 73) \
1584
- x(trans_restart_would_deadlock_recursion_limit, 74) \
1585
- x(trans_restart_write_buffer_flush, 75) \
1586
- x(trans_restart_split_race, 76) \
1587
- x(write_buffer_flush_slowpath, 77) \
1588
- x(write_buffer_flush_sync, 78)
1589
-
1590
- enum bch_persistent_counters {
1591
- #define x(t, n, ...) BCH_COUNTER_##t,
1592
- BCH_PERSISTENT_COUNTERS ()
1593
- #undef x
1594
- BCH_COUNTER_NR
1595
- };
1596
-
1597
- struct bch_sb_field_counters {
1598
- struct bch_sb_field field ;
1599
- __le64 d [];
1600
- };
1601
-
1602
1509
/*
1603
1510
* On clean shutdown, store btree roots and current journal sequence number in
1604
1511
* the superblock:
0 commit comments