14910Swollman/* SPDX-License-Identifier: GPL-2.0 */
2139365Srik#ifndef _BCACHEFS_SB_COUNTERS_FORMAT_H
34910Swollman#define _BCACHEFS_SB_COUNTERS_FORMAT_H
4139823Simp
5139823Simp#define BCH_PERSISTENT_COUNTERS()				\
6139365Srik	x(io_read,					0)	\
725944Sjoerg	x(io_write,					1)	\
84910Swollman	x(io_move,					2)	\
925944Sjoerg	x(bucket_invalidate,				3)	\
1088534Sjoerg	x(bucket_discard,				4)	\
1125944Sjoerg	x(bucket_alloc,					5)	\
124910Swollman	x(bucket_alloc_fail,				6)	\
134910Swollman	x(btree_cache_scan,				7)	\
144910Swollman	x(btree_cache_reap,				8)	\
154910Swollman	x(btree_cache_cannibalize,			9)	\
164910Swollman	x(btree_cache_cannibalize_lock,			10)	\
174910Swollman	x(btree_cache_cannibalize_lock_fail,		11)	\
184910Swollman	x(btree_cache_cannibalize_unlock,		12)	\
1930300Sjoerg	x(btree_node_write,				13)	\
2016288Sgpalmer	x(btree_node_read,				14)	\
2150477Speter	x(btree_node_compact,				15)	\
224910Swollman	x(btree_node_merge,				16)	\
234910Swollman	x(btree_node_split,				17)	\
2440008Sjoerg	x(btree_node_rewrite,				18)	\
2540008Sjoerg	x(btree_node_alloc,				19)	\
2632350Seivind	x(btree_node_free,				20)	\
2754263Sshin	x(btree_node_set_root,				21)	\
2831742Seivind	x(btree_path_relock_fail,			22)	\
294952Sbde	x(btree_path_upgrade_fail,			23)	\
304952Sbde	x(btree_reserve_get_fail,			24)	\
31286001Sae	x(journal_entry_full,				25)	\
3270199Sjhay	x(journal_full,					26)	\
33286001Sae	x(journal_reclaim_finish,			27)	\
3424204Sbde	x(journal_reclaim_start,			28)	\
354910Swollman	x(journal_write,				29)	\
3625706Sjoerg	x(read_promote,					30)	\
3759604Sobrien	x(read_bounce,					31)	\
3829024Sbde	x(read_split,					33)	\
394910Swollman	x(read_retry,					32)	\
4040008Sjoerg	x(read_reuse_race,				34)	\
4130300Sjoerg	x(move_extent_read,				35)	\
424910Swollman	x(move_extent_write,				36)	\
434910Swollman	x(move_extent_finish,				37)	\
44257176Sglebius	x(move_extent_fail,				38)	\
454910Swollman	x(move_extent_start_fail,			39)	\
464910Swollman	x(copygc,					40)	\
4742104Sphk	x(copygc_wait,					41)	\
48196019Srwatson	x(gc_gens_end,					42)	\
4988534Sjoerg	x(gc_gens_start,				43)	\
5088534Sjoerg	x(trans_blocked_journal_reclaim,		44)	\
5188534Sjoerg	x(trans_restart_btree_node_reused,		45)	\
5288534Sjoerg	x(trans_restart_btree_node_split,		46)	\
534910Swollman	x(trans_restart_fault_inject,			47)	\
5430300Sjoerg	x(trans_restart_iter_upgrade,			48)	\
5530300Sjoerg	x(trans_restart_journal_preres_get,		49)	\
564910Swollman	x(trans_restart_journal_reclaim,		50)	\
5788705Sjoerg	x(trans_restart_journal_res_get,		51)	\
5888705Sjoerg	x(trans_restart_key_cache_key_realloced,	52)	\
594910Swollman	x(trans_restart_key_cache_raced,		53)	\
604910Swollman	x(trans_restart_mark_replicas,			54)	\
614910Swollman	x(trans_restart_mem_realloced,			55)	\
624910Swollman	x(trans_restart_memory_allocation_failure,	56)	\
63148385Sume	x(trans_restart_relock,				57)	\
64148385Sume	x(trans_restart_relock_after_fill,		58)	\
65148385Sume	x(trans_restart_relock_key_cache_fill,		59)	\
66148385Sume	x(trans_restart_relock_next_node,		60)	\
67182121Simp	x(trans_restart_relock_parent_for_fill,		61)	\
6888705Sjoerg	x(trans_restart_relock_path,			62)	\
694910Swollman	x(trans_restart_relock_path_intent,		63)	\
704910Swollman	x(trans_restart_too_many_iters,			64)	\
71182121Simp	x(trans_restart_traverse,			65)	\
724910Swollman	x(trans_restart_upgrade,			66)	\
734910Swollman	x(trans_restart_would_deadlock,			67)	\
7425944Sjoerg	x(trans_restart_would_deadlock_write,		68)	\
7525944Sjoerg	x(trans_restart_injected,			69)	\
7625944Sjoerg	x(trans_restart_key_cache_upgrade,		70)	\
7725955Sjoerg	x(trans_traverse_all,				71)	\
7825944Sjoerg	x(transaction_commit,				72)	\
7925944Sjoerg	x(write_super,					73)	\
8025944Sjoerg	x(trans_restart_would_deadlock_recursion_limit,	74)	\
8125955Sjoerg	x(trans_restart_write_buffer_flush,		75)	\
8225955Sjoerg	x(trans_restart_split_race,			76)	\
8325955Sjoerg	x(write_buffer_flush_slowpath,			77)	\
8430300Sjoerg	x(write_buffer_flush_sync,			78)
8530300Sjoerg
8630300Sjoergenum bch_persistent_counters {
8730300Sjoerg#define x(t, n, ...) BCH_COUNTER_##t,
8830300Sjoerg	BCH_PERSISTENT_COUNTERS()
8930300Sjoerg#undef x
9030300Sjoerg	BCH_COUNTER_NR
9130300Sjoerg};
9230300Sjoerg
9325944Sjoergstruct bch_sb_field_counters {
9425944Sjoerg	struct bch_sb_field	field;
9525955Sjoerg	__le64			d[];
9625955Sjoerg};
9745152Sphk
9825944Sjoerg#endif /* _BCACHEFS_SB_COUNTERS_FORMAT_H */
9930300Sjoerg