Commit | Line | Data |
---|---|---|
7394daa8 DH |
1 | /* FS-Cache statistics |
2 | * | |
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | |
4 | * Written by David Howells (dhowells@redhat.com) | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License | |
8 | * as published by the Free Software Foundation; either version | |
9 | * 2 of the License, or (at your option) any later version. | |
10 | */ | |
11 | ||
12 | #define FSCACHE_DEBUG_LEVEL THREAD | |
13 | #include <linux/module.h> | |
14 | #include <linux/proc_fs.h> | |
15 | #include <linux/seq_file.h> | |
16 | #include "internal.h" | |
17 | ||
18 | /* | |
19 | * operation counters | |
20 | */ | |
21 | atomic_t fscache_n_op_pend; | |
22 | atomic_t fscache_n_op_run; | |
23 | atomic_t fscache_n_op_enqueue; | |
7394daa8 | 24 | atomic_t fscache_n_op_deferred_release; |
03cdd0e4 | 25 | atomic_t fscache_n_op_initialised; |
7394daa8 DH |
26 | atomic_t fscache_n_op_release; |
27 | atomic_t fscache_n_op_gc; | |
5753c441 | 28 | atomic_t fscache_n_op_cancelled; |
e3d4d28b | 29 | atomic_t fscache_n_op_rejected; |
7394daa8 DH |
30 | |
31 | atomic_t fscache_n_attr_changed; | |
32 | atomic_t fscache_n_attr_changed_ok; | |
33 | atomic_t fscache_n_attr_changed_nobufs; | |
34 | atomic_t fscache_n_attr_changed_nomem; | |
35 | atomic_t fscache_n_attr_changed_calls; | |
36 | ||
37 | atomic_t fscache_n_allocs; | |
38 | atomic_t fscache_n_allocs_ok; | |
39 | atomic_t fscache_n_allocs_wait; | |
40 | atomic_t fscache_n_allocs_nobufs; | |
5753c441 | 41 | atomic_t fscache_n_allocs_intr; |
60d543ca | 42 | atomic_t fscache_n_allocs_object_dead; |
7394daa8 DH |
43 | atomic_t fscache_n_alloc_ops; |
44 | atomic_t fscache_n_alloc_op_waits; | |
45 | ||
46 | atomic_t fscache_n_retrievals; | |
47 | atomic_t fscache_n_retrievals_ok; | |
48 | atomic_t fscache_n_retrievals_wait; | |
49 | atomic_t fscache_n_retrievals_nodata; | |
50 | atomic_t fscache_n_retrievals_nobufs; | |
51 | atomic_t fscache_n_retrievals_intr; | |
52 | atomic_t fscache_n_retrievals_nomem; | |
60d543ca | 53 | atomic_t fscache_n_retrievals_object_dead; |
7394daa8 DH |
54 | atomic_t fscache_n_retrieval_ops; |
55 | atomic_t fscache_n_retrieval_op_waits; | |
56 | ||
57 | atomic_t fscache_n_stores; | |
58 | atomic_t fscache_n_stores_ok; | |
59 | atomic_t fscache_n_stores_again; | |
60 | atomic_t fscache_n_stores_nobufs; | |
61 | atomic_t fscache_n_stores_oom; | |
62 | atomic_t fscache_n_store_ops; | |
63 | atomic_t fscache_n_store_calls; | |
1bccf513 DH |
64 | atomic_t fscache_n_store_pages; |
65 | atomic_t fscache_n_store_radix_deletes; | |
66 | atomic_t fscache_n_store_pages_over_limit; | |
7394daa8 | 67 | |
201a1542 DH |
68 | atomic_t fscache_n_store_vmscan_not_storing; |
69 | atomic_t fscache_n_store_vmscan_gone; | |
70 | atomic_t fscache_n_store_vmscan_busy; | |
71 | atomic_t fscache_n_store_vmscan_cancelled; | |
8c209ce7 | 72 | atomic_t fscache_n_store_vmscan_wait; |
201a1542 | 73 | |
7394daa8 DH |
74 | atomic_t fscache_n_marks; |
75 | atomic_t fscache_n_uncaches; | |
76 | ||
77 | atomic_t fscache_n_acquires; | |
78 | atomic_t fscache_n_acquires_null; | |
79 | atomic_t fscache_n_acquires_no_cache; | |
80 | atomic_t fscache_n_acquires_ok; | |
81 | atomic_t fscache_n_acquires_nobufs; | |
82 | atomic_t fscache_n_acquires_oom; | |
83 | ||
ef778e7a DH |
84 | atomic_t fscache_n_invalidates; |
85 | atomic_t fscache_n_invalidates_run; | |
86 | ||
7394daa8 DH |
87 | atomic_t fscache_n_updates; |
88 | atomic_t fscache_n_updates_null; | |
89 | atomic_t fscache_n_updates_run; | |
90 | ||
91 | atomic_t fscache_n_relinquishes; | |
92 | atomic_t fscache_n_relinquishes_null; | |
93 | atomic_t fscache_n_relinquishes_waitcrt; | |
2175bb06 | 94 | atomic_t fscache_n_relinquishes_retire; |
7394daa8 DH |
95 | |
96 | atomic_t fscache_n_cookie_index; | |
97 | atomic_t fscache_n_cookie_data; | |
98 | atomic_t fscache_n_cookie_special; | |
99 | ||
100 | atomic_t fscache_n_object_alloc; | |
101 | atomic_t fscache_n_object_no_alloc; | |
102 | atomic_t fscache_n_object_lookups; | |
103 | atomic_t fscache_n_object_lookups_negative; | |
104 | atomic_t fscache_n_object_lookups_positive; | |
fee096de | 105 | atomic_t fscache_n_object_lookups_timed_out; |
7394daa8 DH |
106 | atomic_t fscache_n_object_created; |
107 | atomic_t fscache_n_object_avail; | |
108 | atomic_t fscache_n_object_dead; | |
109 | ||
110 | atomic_t fscache_n_checkaux_none; | |
111 | atomic_t fscache_n_checkaux_okay; | |
112 | atomic_t fscache_n_checkaux_update; | |
113 | atomic_t fscache_n_checkaux_obsolete; | |
114 | ||
52bd75fd DH |
115 | atomic_t fscache_n_cop_alloc_object; |
116 | atomic_t fscache_n_cop_lookup_object; | |
117 | atomic_t fscache_n_cop_lookup_complete; | |
118 | atomic_t fscache_n_cop_grab_object; | |
ef778e7a | 119 | atomic_t fscache_n_cop_invalidate_object; |
52bd75fd DH |
120 | atomic_t fscache_n_cop_update_object; |
121 | atomic_t fscache_n_cop_drop_object; | |
122 | atomic_t fscache_n_cop_put_object; | |
123 | atomic_t fscache_n_cop_sync_cache; | |
124 | atomic_t fscache_n_cop_attr_changed; | |
125 | atomic_t fscache_n_cop_read_or_alloc_page; | |
126 | atomic_t fscache_n_cop_read_or_alloc_pages; | |
127 | atomic_t fscache_n_cop_allocate_page; | |
128 | atomic_t fscache_n_cop_allocate_pages; | |
129 | atomic_t fscache_n_cop_write_page; | |
130 | atomic_t fscache_n_cop_uncache_page; | |
131 | atomic_t fscache_n_cop_dissociate_pages; | |
132 | ||
182d919b DH |
133 | atomic_t fscache_n_cache_no_space_reject; |
134 | atomic_t fscache_n_cache_stale_objects; | |
135 | atomic_t fscache_n_cache_retired_objects; | |
136 | atomic_t fscache_n_cache_culled_objects; | |
137 | ||
7394daa8 DH |
138 | /* |
139 | * display the general statistics | |
140 | */ | |
3f3942ac | 141 | int fscache_stats_show(struct seq_file *m, void *v) |
7394daa8 DH |
142 | { |
143 | seq_puts(m, "FS-Cache statistics\n"); | |
144 | ||
145 | seq_printf(m, "Cookies: idx=%u dat=%u spc=%u\n", | |
146 | atomic_read(&fscache_n_cookie_index), | |
147 | atomic_read(&fscache_n_cookie_data), | |
148 | atomic_read(&fscache_n_cookie_special)); | |
149 | ||
150 | seq_printf(m, "Objects: alc=%u nal=%u avl=%u ded=%u\n", | |
151 | atomic_read(&fscache_n_object_alloc), | |
152 | atomic_read(&fscache_n_object_no_alloc), | |
153 | atomic_read(&fscache_n_object_avail), | |
154 | atomic_read(&fscache_n_object_dead)); | |
155 | seq_printf(m, "ChkAux : non=%u ok=%u upd=%u obs=%u\n", | |
156 | atomic_read(&fscache_n_checkaux_none), | |
157 | atomic_read(&fscache_n_checkaux_okay), | |
158 | atomic_read(&fscache_n_checkaux_update), | |
159 | atomic_read(&fscache_n_checkaux_obsolete)); | |
160 | ||
161 | seq_printf(m, "Pages : mrk=%u unc=%u\n", | |
162 | atomic_read(&fscache_n_marks), | |
163 | atomic_read(&fscache_n_uncaches)); | |
164 | ||
165 | seq_printf(m, "Acquire: n=%u nul=%u noc=%u ok=%u nbf=%u" | |
166 | " oom=%u\n", | |
167 | atomic_read(&fscache_n_acquires), | |
168 | atomic_read(&fscache_n_acquires_null), | |
169 | atomic_read(&fscache_n_acquires_no_cache), | |
170 | atomic_read(&fscache_n_acquires_ok), | |
171 | atomic_read(&fscache_n_acquires_nobufs), | |
172 | atomic_read(&fscache_n_acquires_oom)); | |
173 | ||
fee096de | 174 | seq_printf(m, "Lookups: n=%u neg=%u pos=%u crt=%u tmo=%u\n", |
7394daa8 DH |
175 | atomic_read(&fscache_n_object_lookups), |
176 | atomic_read(&fscache_n_object_lookups_negative), | |
177 | atomic_read(&fscache_n_object_lookups_positive), | |
cc4fc29e DH |
178 | atomic_read(&fscache_n_object_created), |
179 | atomic_read(&fscache_n_object_lookups_timed_out)); | |
7394daa8 | 180 | |
ef778e7a DH |
181 | seq_printf(m, "Invals : n=%u run=%u\n", |
182 | atomic_read(&fscache_n_invalidates), | |
183 | atomic_read(&fscache_n_invalidates_run)); | |
184 | ||
7394daa8 DH |
185 | seq_printf(m, "Updates: n=%u nul=%u run=%u\n", |
186 | atomic_read(&fscache_n_updates), | |
187 | atomic_read(&fscache_n_updates_null), | |
188 | atomic_read(&fscache_n_updates_run)); | |
189 | ||
2175bb06 | 190 | seq_printf(m, "Relinqs: n=%u nul=%u wcr=%u rtr=%u\n", |
7394daa8 DH |
191 | atomic_read(&fscache_n_relinquishes), |
192 | atomic_read(&fscache_n_relinquishes_null), | |
2175bb06 DH |
193 | atomic_read(&fscache_n_relinquishes_waitcrt), |
194 | atomic_read(&fscache_n_relinquishes_retire)); | |
7394daa8 DH |
195 | |
196 | seq_printf(m, "AttrChg: n=%u ok=%u nbf=%u oom=%u run=%u\n", | |
197 | atomic_read(&fscache_n_attr_changed), | |
198 | atomic_read(&fscache_n_attr_changed_ok), | |
199 | atomic_read(&fscache_n_attr_changed_nobufs), | |
200 | atomic_read(&fscache_n_attr_changed_nomem), | |
201 | atomic_read(&fscache_n_attr_changed_calls)); | |
202 | ||
5753c441 | 203 | seq_printf(m, "Allocs : n=%u ok=%u wt=%u nbf=%u int=%u\n", |
7394daa8 DH |
204 | atomic_read(&fscache_n_allocs), |
205 | atomic_read(&fscache_n_allocs_ok), | |
206 | atomic_read(&fscache_n_allocs_wait), | |
5753c441 DH |
207 | atomic_read(&fscache_n_allocs_nobufs), |
208 | atomic_read(&fscache_n_allocs_intr)); | |
60d543ca | 209 | seq_printf(m, "Allocs : ops=%u owt=%u abt=%u\n", |
7394daa8 | 210 | atomic_read(&fscache_n_alloc_ops), |
60d543ca DH |
211 | atomic_read(&fscache_n_alloc_op_waits), |
212 | atomic_read(&fscache_n_allocs_object_dead)); | |
7394daa8 DH |
213 | |
214 | seq_printf(m, "Retrvls: n=%u ok=%u wt=%u nod=%u nbf=%u" | |
215 | " int=%u oom=%u\n", | |
216 | atomic_read(&fscache_n_retrievals), | |
217 | atomic_read(&fscache_n_retrievals_ok), | |
218 | atomic_read(&fscache_n_retrievals_wait), | |
219 | atomic_read(&fscache_n_retrievals_nodata), | |
220 | atomic_read(&fscache_n_retrievals_nobufs), | |
221 | atomic_read(&fscache_n_retrievals_intr), | |
222 | atomic_read(&fscache_n_retrievals_nomem)); | |
60d543ca | 223 | seq_printf(m, "Retrvls: ops=%u owt=%u abt=%u\n", |
7394daa8 | 224 | atomic_read(&fscache_n_retrieval_ops), |
60d543ca DH |
225 | atomic_read(&fscache_n_retrieval_op_waits), |
226 | atomic_read(&fscache_n_retrievals_object_dead)); | |
7394daa8 DH |
227 | |
228 | seq_printf(m, "Stores : n=%u ok=%u agn=%u nbf=%u oom=%u\n", | |
229 | atomic_read(&fscache_n_stores), | |
230 | atomic_read(&fscache_n_stores_ok), | |
231 | atomic_read(&fscache_n_stores_again), | |
232 | atomic_read(&fscache_n_stores_nobufs), | |
233 | atomic_read(&fscache_n_stores_oom)); | |
1bccf513 | 234 | seq_printf(m, "Stores : ops=%u run=%u pgs=%u rxd=%u olm=%u\n", |
7394daa8 | 235 | atomic_read(&fscache_n_store_ops), |
1bccf513 DH |
236 | atomic_read(&fscache_n_store_calls), |
237 | atomic_read(&fscache_n_store_pages), | |
238 | atomic_read(&fscache_n_store_radix_deletes), | |
239 | atomic_read(&fscache_n_store_pages_over_limit)); | |
7394daa8 | 240 | |
8c209ce7 | 241 | seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u wt=%u\n", |
201a1542 DH |
242 | atomic_read(&fscache_n_store_vmscan_not_storing), |
243 | atomic_read(&fscache_n_store_vmscan_gone), | |
244 | atomic_read(&fscache_n_store_vmscan_busy), | |
8c209ce7 DH |
245 | atomic_read(&fscache_n_store_vmscan_cancelled), |
246 | atomic_read(&fscache_n_store_vmscan_wait)); | |
201a1542 | 247 | |
e3d4d28b | 248 | seq_printf(m, "Ops : pend=%u run=%u enq=%u can=%u rej=%u\n", |
7394daa8 DH |
249 | atomic_read(&fscache_n_op_pend), |
250 | atomic_read(&fscache_n_op_run), | |
5753c441 | 251 | atomic_read(&fscache_n_op_enqueue), |
e3d4d28b DH |
252 | atomic_read(&fscache_n_op_cancelled), |
253 | atomic_read(&fscache_n_op_rejected)); | |
03cdd0e4 DH |
254 | seq_printf(m, "Ops : ini=%u dfr=%u rel=%u gc=%u\n", |
255 | atomic_read(&fscache_n_op_initialised), | |
7394daa8 DH |
256 | atomic_read(&fscache_n_op_deferred_release), |
257 | atomic_read(&fscache_n_op_release), | |
258 | atomic_read(&fscache_n_op_gc)); | |
52bd75fd DH |
259 | |
260 | seq_printf(m, "CacheOp: alo=%d luo=%d luc=%d gro=%d\n", | |
261 | atomic_read(&fscache_n_cop_alloc_object), | |
262 | atomic_read(&fscache_n_cop_lookup_object), | |
263 | atomic_read(&fscache_n_cop_lookup_complete), | |
264 | atomic_read(&fscache_n_cop_grab_object)); | |
ef778e7a DH |
265 | seq_printf(m, "CacheOp: inv=%d upo=%d dro=%d pto=%d atc=%d syn=%d\n", |
266 | atomic_read(&fscache_n_cop_invalidate_object), | |
52bd75fd DH |
267 | atomic_read(&fscache_n_cop_update_object), |
268 | atomic_read(&fscache_n_cop_drop_object), | |
269 | atomic_read(&fscache_n_cop_put_object), | |
270 | atomic_read(&fscache_n_cop_attr_changed), | |
271 | atomic_read(&fscache_n_cop_sync_cache)); | |
272 | seq_printf(m, "CacheOp: rap=%d ras=%d alp=%d als=%d wrp=%d ucp=%d dsp=%d\n", | |
273 | atomic_read(&fscache_n_cop_read_or_alloc_page), | |
274 | atomic_read(&fscache_n_cop_read_or_alloc_pages), | |
275 | atomic_read(&fscache_n_cop_allocate_page), | |
276 | atomic_read(&fscache_n_cop_allocate_pages), | |
277 | atomic_read(&fscache_n_cop_write_page), | |
278 | atomic_read(&fscache_n_cop_uncache_page), | |
279 | atomic_read(&fscache_n_cop_dissociate_pages)); | |
182d919b DH |
280 | seq_printf(m, "CacheEv: nsp=%d stl=%d rtr=%d cul=%d\n", |
281 | atomic_read(&fscache_n_cache_no_space_reject), | |
282 | atomic_read(&fscache_n_cache_stale_objects), | |
283 | atomic_read(&fscache_n_cache_retired_objects), | |
284 | atomic_read(&fscache_n_cache_culled_objects)); | |
7394daa8 DH |
285 | return 0; |
286 | } |