Commit | Line | Data |
---|---|---|
289af54c DH |
1 | // SPDX-License-Identifier: GPL-2.0-or-later |
2 | /* Netfs support statistics | |
3 | * | |
4 | * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved. | |
5 | * Written by David Howells (dhowells@redhat.com) | |
6 | */ | |
7 | ||
8 | #include <linux/export.h> | |
9 | #include <linux/seq_file.h> | |
289af54c DH |
10 | #include "internal.h" |
11 | ||
016dc851 | 12 | atomic_t netfs_n_rh_dio_read; |
4088e389 | 13 | atomic_t netfs_n_rh_dio_write; |
289af54c DH |
14 | atomic_t netfs_n_rh_readahead; |
15 | atomic_t netfs_n_rh_readpage; | |
16 | atomic_t netfs_n_rh_rreq; | |
17 | atomic_t netfs_n_rh_sreq; | |
18 | atomic_t netfs_n_rh_download; | |
19 | atomic_t netfs_n_rh_download_done; | |
20 | atomic_t netfs_n_rh_download_failed; | |
21 | atomic_t netfs_n_rh_download_instead; | |
22 | atomic_t netfs_n_rh_read; | |
23 | atomic_t netfs_n_rh_read_done; | |
24 | atomic_t netfs_n_rh_read_failed; | |
25 | atomic_t netfs_n_rh_zero; | |
26 | atomic_t netfs_n_rh_short_read; | |
27 | atomic_t netfs_n_rh_write; | |
e1b1240c | 28 | atomic_t netfs_n_rh_write_begin; |
289af54c DH |
29 | atomic_t netfs_n_rh_write_done; |
30 | atomic_t netfs_n_rh_write_failed; | |
e1b1240c | 31 | atomic_t netfs_n_rh_write_zskip; |
16af134c DH |
32 | atomic_t netfs_n_wh_upload; |
33 | atomic_t netfs_n_wh_upload_done; | |
34 | atomic_t netfs_n_wh_upload_failed; | |
35 | atomic_t netfs_n_wh_write; | |
36 | atomic_t netfs_n_wh_write_done; | |
37 | atomic_t netfs_n_wh_write_failed; | |
289af54c | 38 | |
7eb5b3e3 | 39 | int netfs_stats_show(struct seq_file *m, void *v) |
289af54c | 40 | { |
4088e389 | 41 | seq_printf(m, "Netfs : DR=%u DW=%u RA=%u RP=%u WB=%u WBZ=%u\n", |
016dc851 | 42 | atomic_read(&netfs_n_rh_dio_read), |
4088e389 | 43 | atomic_read(&netfs_n_rh_dio_write), |
289af54c DH |
44 | atomic_read(&netfs_n_rh_readahead), |
45 | atomic_read(&netfs_n_rh_readpage), | |
e1b1240c | 46 | atomic_read(&netfs_n_rh_write_begin), |
4088e389 | 47 | atomic_read(&netfs_n_rh_write_zskip)); |
7eb5b3e3 | 48 | seq_printf(m, "Netfs : ZR=%u sh=%u sk=%u\n", |
289af54c | 49 | atomic_read(&netfs_n_rh_zero), |
e1b1240c DH |
50 | atomic_read(&netfs_n_rh_short_read), |
51 | atomic_read(&netfs_n_rh_write_zskip)); | |
7eb5b3e3 | 52 | seq_printf(m, "Netfs : DL=%u ds=%u df=%u di=%u\n", |
289af54c DH |
53 | atomic_read(&netfs_n_rh_download), |
54 | atomic_read(&netfs_n_rh_download_done), | |
55 | atomic_read(&netfs_n_rh_download_failed), | |
56 | atomic_read(&netfs_n_rh_download_instead)); | |
7eb5b3e3 | 57 | seq_printf(m, "Netfs : RD=%u rs=%u rf=%u\n", |
289af54c DH |
58 | atomic_read(&netfs_n_rh_read), |
59 | atomic_read(&netfs_n_rh_read_done), | |
60 | atomic_read(&netfs_n_rh_read_failed)); | |
16af134c DH |
61 | seq_printf(m, "Netfs : UL=%u us=%u uf=%u\n", |
62 | atomic_read(&netfs_n_wh_upload), | |
63 | atomic_read(&netfs_n_wh_upload_done), | |
64 | atomic_read(&netfs_n_wh_upload_failed)); | |
7eb5b3e3 | 65 | seq_printf(m, "Netfs : WR=%u ws=%u wf=%u\n", |
16af134c DH |
66 | atomic_read(&netfs_n_wh_write), |
67 | atomic_read(&netfs_n_wh_write_done), | |
68 | atomic_read(&netfs_n_wh_write_failed)); | |
4088e389 DH |
69 | seq_printf(m, "Netfs : rr=%u sr=%u\n", |
70 | atomic_read(&netfs_n_rh_rreq), | |
71 | atomic_read(&netfs_n_rh_sreq)); | |
7eb5b3e3 | 72 | return fscache_stats_show(m); |
289af54c DH |
73 | } |
74 | EXPORT_SYMBOL(netfs_stats_show); |