1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright 2023 Red Hat
12 STATISTICS_VERSION
= 36,
15 struct block_allocator_statistics
{
16 /* The total number of slabs from which blocks may be allocated */
18 /* The total number of slabs from which blocks have ever been allocated */
20 /* The number of times since loading that a slab has been re-opened */
25 * Counters for tracking the number of items written (blocks, requests, etc.)
26 * that keep track of totals at steps in the write pipeline. Three counters
27 * allow the number of buffered, in-memory items and the number of in-flight,
28 * unacknowledged writes to be derived, while still tracking totals for
31 struct commit_statistics
{
32 /* The total number of items on which processing has started */
34 /* The total number of items for which a write operation has been issued */
36 /* The total number of items for which a write operation has completed */
40 /** Counters for events in the recovery journal */
41 struct recovery_journal_statistics
{
42 /* Number of times the on-disk journal was full */
44 /* Number of times the recovery journal requested slab journal commits. */
45 u64 slab_journal_commits_requested
;
46 /* Write/Commit totals for individual journal entries */
47 struct commit_statistics entries
;
48 /* Write/Commit totals for journal blocks */
49 struct commit_statistics blocks
;
52 /** The statistics for the compressed block packer. */
53 struct packer_statistics
{
54 /* Number of compressed data items written since startup */
55 u64 compressed_fragments_written
;
56 /* Number of blocks containing compressed items written since startup */
57 u64 compressed_blocks_written
;
58 /* Number of VIOs that are pending in the packer */
59 u64 compressed_fragments_in_packer
;
62 /** The statistics for the slab journals. */
63 struct slab_journal_statistics
{
64 /* Number of times the on-disk journal was full */
66 /* Number of times an entry was added over the flush threshold */
68 /* Number of times an entry was added over the block threshold */
70 /* Number of times a tail block was written */
72 /* Number of times we had to wait for the tail to write */
76 /** The statistics for the slab summary. */
77 struct slab_summary_statistics
{
78 /* Number of blocks written */
82 /** The statistics for the reference counts. */
83 struct ref_counts_statistics
{
84 /* Number of reference blocks written */
88 /** The statistics for the block map. */
89 struct block_map_statistics
{
90 /* number of dirty (resident) pages */
92 /* number of clean (resident) pages */
94 /* number of free pages */
96 /* number of pages in failed state */
98 /* number of pages incoming */
100 /* number of pages outgoing */
102 /* how many times free page not avail */
104 /* number of get_vdo_page() calls for read */
106 /* number of get_vdo_page() calls for write */
108 /* number of times pages failed to read */
110 /* number of times pages failed to write */
112 /* number of gets that are reclaimed */
114 /* number of gets for outgoing pages */
116 /* number of gets that were already there */
118 /* number of gets requiring discard */
119 u64 discard_required
;
120 /* number of gets enqueued for their page */
122 /* number of gets that have to fetch */
124 /* number of page fetches */
126 /* number of page saves */
128 /* the number of flushes issued */
132 /** The dedupe statistics from hash locks */
133 struct hash_lock_statistics
{
134 /* Number of times the UDS advice proved correct */
135 u64 dedupe_advice_valid
;
136 /* Number of times the UDS advice proved incorrect */
137 u64 dedupe_advice_stale
;
138 /* Number of writes with the same data as another in-flight write */
139 u64 concurrent_data_matches
;
140 /* Number of writes whose hash collided with an in-flight write */
141 u64 concurrent_hash_collisions
;
142 /* Current number of dedupe queries that are in flight */
143 u32 curr_dedupe_queries
;
146 /** Counts of error conditions in VDO. */
147 struct error_statistics
{
148 /* number of times VDO got an invalid dedupe advice PBN from UDS */
149 u64 invalid_advice_pbn_count
;
150 /* number of times a VIO completed with a VDO_NO_SPACE error */
151 u64 no_space_error_count
;
152 /* number of times a VIO completed with a VDO_READ_ONLY error */
153 u64 read_only_error_count
;
157 /* Number of REQ_OP_READ bios */
159 /* Number of REQ_OP_WRITE bios with data */
161 /* Number of bios tagged with REQ_PREFLUSH and containing no data */
163 /* Number of REQ_OP_DISCARD bios */
165 /* Number of bios tagged with REQ_PREFLUSH */
167 /* Number of bios tagged with REQ_FUA */
171 struct memory_usage
{
172 /* Tracked bytes currently allocated. */
174 /* Maximum tracked bytes allocated. */
178 /** UDS index statistics */
179 struct index_statistics
{
180 /* Number of records stored in the index */
182 /* Number of post calls that found an existing entry */
184 /* Number of post calls that added a new entry */
186 /* Number of query calls that found an existing entry */
188 /* Number of query calls that added a new entry */
189 u64 queries_not_found
;
190 /* Number of update calls that found an existing entry */
192 /* Number of update calls that added a new entry */
193 u64 updates_not_found
;
194 /* Number of entries discarded */
195 u64 entries_discarded
;
198 /** The statistics of the vdo service. */
199 struct vdo_statistics
{
201 /* Number of blocks used for data */
202 u64 data_blocks_used
;
203 /* Number of blocks used for VDO metadata */
204 u64 overhead_blocks_used
;
205 /* Number of logical blocks that are currently mapped to physical blocks */
206 u64 logical_blocks_used
;
207 /* number of physical blocks */
208 block_count_t physical_blocks
;
209 /* number of logical blocks */
210 block_count_t logical_blocks
;
211 /* Size of the block map page cache, in bytes */
212 u64 block_map_cache_size
;
213 /* The physical block size */
215 /* Number of times the VDO has successfully recovered */
216 u64 complete_recoveries
;
217 /* Number of times the VDO has recovered from read-only mode */
218 u64 read_only_recoveries
;
219 /* String describing the operating mode of the VDO */
221 /* Whether the VDO is in recovery mode */
222 bool in_recovery_mode
;
223 /* What percentage of recovery mode work has been completed */
224 u8 recovery_percentage
;
225 /* The statistics for the compressed block packer */
226 struct packer_statistics packer
;
227 /* Counters for events in the block allocator */
228 struct block_allocator_statistics allocator
;
229 /* Counters for events in the recovery journal */
230 struct recovery_journal_statistics journal
;
231 /* The statistics for the slab journals */
232 struct slab_journal_statistics slab_journal
;
233 /* The statistics for the slab summary */
234 struct slab_summary_statistics slab_summary
;
235 /* The statistics for the reference counts */
236 struct ref_counts_statistics ref_counts
;
237 /* The statistics for the block map */
238 struct block_map_statistics block_map
;
239 /* The dedupe statistics from hash locks */
240 struct hash_lock_statistics hash_lock
;
241 /* Counts of error conditions */
242 struct error_statistics errors
;
243 /* The VDO instance */
245 /* Current number of active VIOs */
246 u32 current_vios_in_progress
;
247 /* Maximum number of active VIOs */
249 /* Number of times the UDS index was too slow in responding */
250 u64 dedupe_advice_timeouts
;
251 /* Number of flush requests submitted to the storage device */
253 /* Logical block size */
254 u64 logical_block_size
;
255 /* Bios submitted into VDO from above */
256 struct bio_stats bios_in
;
257 struct bio_stats bios_in_partial
;
258 /* Bios submitted onward for user data */
259 struct bio_stats bios_out
;
260 /* Bios submitted onward for metadata */
261 struct bio_stats bios_meta
;
262 struct bio_stats bios_journal
;
263 struct bio_stats bios_page_cache
;
264 struct bio_stats bios_out_completed
;
265 struct bio_stats bios_meta_completed
;
266 struct bio_stats bios_journal_completed
;
267 struct bio_stats bios_page_cache_completed
;
268 struct bio_stats bios_acknowledged
;
269 struct bio_stats bios_acknowledged_partial
;
270 /* Current number of bios in progress */
271 struct bio_stats bios_in_progress
;
272 /* Memory usage stats. */
273 struct memory_usage memory_usage
;
274 /* The statistics for the UDS index */
275 struct index_statistics index
;
278 #endif /* not STATISTICS_H */