xref: /linux/fs/bcachefs/sb-counters_format.h (revision 1553a1c48281243359a9529a10ddb551f3b967ab)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_SB_COUNTERS_FORMAT_H
3 #define _BCACHEFS_SB_COUNTERS_FORMAT_H
4 
5 #define BCH_PERSISTENT_COUNTERS()				\
6 	x(io_read,					0)	\
7 	x(io_write,					1)	\
8 	x(io_move,					2)	\
9 	x(bucket_invalidate,				3)	\
10 	x(bucket_discard,				4)	\
11 	x(bucket_alloc,					5)	\
12 	x(bucket_alloc_fail,				6)	\
13 	x(btree_cache_scan,				7)	\
14 	x(btree_cache_reap,				8)	\
15 	x(btree_cache_cannibalize,			9)	\
16 	x(btree_cache_cannibalize_lock,			10)	\
17 	x(btree_cache_cannibalize_lock_fail,		11)	\
18 	x(btree_cache_cannibalize_unlock,		12)	\
19 	x(btree_node_write,				13)	\
20 	x(btree_node_read,				14)	\
21 	x(btree_node_compact,				15)	\
22 	x(btree_node_merge,				16)	\
23 	x(btree_node_split,				17)	\
24 	x(btree_node_rewrite,				18)	\
25 	x(btree_node_alloc,				19)	\
26 	x(btree_node_free,				20)	\
27 	x(btree_node_set_root,				21)	\
28 	x(btree_path_relock_fail,			22)	\
29 	x(btree_path_upgrade_fail,			23)	\
30 	x(btree_reserve_get_fail,			24)	\
31 	x(journal_entry_full,				25)	\
32 	x(journal_full,					26)	\
33 	x(journal_reclaim_finish,			27)	\
34 	x(journal_reclaim_start,			28)	\
35 	x(journal_write,				29)	\
36 	x(read_promote,					30)	\
37 	x(read_bounce,					31)	\
38 	x(read_split,					33)	\
39 	x(read_retry,					32)	\
40 	x(read_reuse_race,				34)	\
41 	x(move_extent_read,				35)	\
42 	x(move_extent_write,				36)	\
43 	x(move_extent_finish,				37)	\
44 	x(move_extent_fail,				38)	\
45 	x(move_extent_start_fail,			39)	\
46 	x(copygc,					40)	\
47 	x(copygc_wait,					41)	\
48 	x(gc_gens_end,					42)	\
49 	x(gc_gens_start,				43)	\
50 	x(trans_blocked_journal_reclaim,		44)	\
51 	x(trans_restart_btree_node_reused,		45)	\
52 	x(trans_restart_btree_node_split,		46)	\
53 	x(trans_restart_fault_inject,			47)	\
54 	x(trans_restart_iter_upgrade,			48)	\
55 	x(trans_restart_journal_preres_get,		49)	\
56 	x(trans_restart_journal_reclaim,		50)	\
57 	x(trans_restart_journal_res_get,		51)	\
58 	x(trans_restart_key_cache_key_realloced,	52)	\
59 	x(trans_restart_key_cache_raced,		53)	\
60 	x(trans_restart_mark_replicas,			54)	\
61 	x(trans_restart_mem_realloced,			55)	\
62 	x(trans_restart_memory_allocation_failure,	56)	\
63 	x(trans_restart_relock,				57)	\
64 	x(trans_restart_relock_after_fill,		58)	\
65 	x(trans_restart_relock_key_cache_fill,		59)	\
66 	x(trans_restart_relock_next_node,		60)	\
67 	x(trans_restart_relock_parent_for_fill,		61)	\
68 	x(trans_restart_relock_path,			62)	\
69 	x(trans_restart_relock_path_intent,		63)	\
70 	x(trans_restart_too_many_iters,			64)	\
71 	x(trans_restart_traverse,			65)	\
72 	x(trans_restart_upgrade,			66)	\
73 	x(trans_restart_would_deadlock,			67)	\
74 	x(trans_restart_would_deadlock_write,		68)	\
75 	x(trans_restart_injected,			69)	\
76 	x(trans_restart_key_cache_upgrade,		70)	\
77 	x(trans_traverse_all,				71)	\
78 	x(transaction_commit,				72)	\
79 	x(write_super,					73)	\
80 	x(trans_restart_would_deadlock_recursion_limit,	74)	\
81 	x(trans_restart_write_buffer_flush,		75)	\
82 	x(trans_restart_split_race,			76)	\
83 	x(write_buffer_flush_slowpath,			77)	\
84 	x(write_buffer_flush_sync,			78)
85 
86 enum bch_persistent_counters {
87 #define x(t, n, ...) BCH_COUNTER_##t,
88 	BCH_PERSISTENT_COUNTERS()
89 #undef x
90 	BCH_COUNTER_NR
91 };
92 
93 struct bch_sb_field_counters {
94 	struct bch_sb_field	field;
95 	__le64			d[];
96 };
97 
98 #endif /* _BCACHEFS_SB_COUNTERS_FORMAT_H */
99