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