blob: 9ae538c853787ee4284bbfaab6e9328885a2f564 [file] [log] [blame]
David Howells289af542020-11-03 11:32:41 +00001// 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>
10#include <linux/netfs.h>
11#include "internal.h"
12
13atomic_t netfs_n_rh_readahead;
14atomic_t netfs_n_rh_readpage;
15atomic_t netfs_n_rh_rreq;
16atomic_t netfs_n_rh_sreq;
17atomic_t netfs_n_rh_download;
18atomic_t netfs_n_rh_download_done;
19atomic_t netfs_n_rh_download_failed;
20atomic_t netfs_n_rh_download_instead;
21atomic_t netfs_n_rh_read;
22atomic_t netfs_n_rh_read_done;
23atomic_t netfs_n_rh_read_failed;
24atomic_t netfs_n_rh_zero;
25atomic_t netfs_n_rh_short_read;
26atomic_t netfs_n_rh_write;
David Howellse1b12402020-09-22 11:06:07 +010027atomic_t netfs_n_rh_write_begin;
David Howells289af542020-11-03 11:32:41 +000028atomic_t netfs_n_rh_write_done;
29atomic_t netfs_n_rh_write_failed;
David Howellse1b12402020-09-22 11:06:07 +010030atomic_t netfs_n_rh_write_zskip;
David Howells289af542020-11-03 11:32:41 +000031
32void netfs_stats_show(struct seq_file *m)
33{
David Howellse1b12402020-09-22 11:06:07 +010034 seq_printf(m, "RdHelp : RA=%u RP=%u WB=%u WBZ=%u rr=%u sr=%u\n",
David Howells289af542020-11-03 11:32:41 +000035 atomic_read(&netfs_n_rh_readahead),
36 atomic_read(&netfs_n_rh_readpage),
David Howellse1b12402020-09-22 11:06:07 +010037 atomic_read(&netfs_n_rh_write_begin),
38 atomic_read(&netfs_n_rh_write_zskip),
David Howells289af542020-11-03 11:32:41 +000039 atomic_read(&netfs_n_rh_rreq),
40 atomic_read(&netfs_n_rh_sreq));
David Howellse1b12402020-09-22 11:06:07 +010041 seq_printf(m, "RdHelp : ZR=%u sh=%u sk=%u\n",
David Howells289af542020-11-03 11:32:41 +000042 atomic_read(&netfs_n_rh_zero),
David Howellse1b12402020-09-22 11:06:07 +010043 atomic_read(&netfs_n_rh_short_read),
44 atomic_read(&netfs_n_rh_write_zskip));
David Howells289af542020-11-03 11:32:41 +000045 seq_printf(m, "RdHelp : DL=%u ds=%u df=%u di=%u\n",
46 atomic_read(&netfs_n_rh_download),
47 atomic_read(&netfs_n_rh_download_done),
48 atomic_read(&netfs_n_rh_download_failed),
49 atomic_read(&netfs_n_rh_download_instead));
50 seq_printf(m, "RdHelp : RD=%u rs=%u rf=%u\n",
51 atomic_read(&netfs_n_rh_read),
52 atomic_read(&netfs_n_rh_read_done),
53 atomic_read(&netfs_n_rh_read_failed));
54 seq_printf(m, "RdHelp : WR=%u ws=%u wf=%u\n",
55 atomic_read(&netfs_n_rh_write),
56 atomic_read(&netfs_n_rh_write_done),
57 atomic_read(&netfs_n_rh_write_failed));
58}
59EXPORT_SYMBOL(netfs_stats_show);