]> Git Repo - linux.git/blame - fs/nfsd/stats.c
nfsd: remove unused stats counters
[linux.git] / fs / nfsd / stats.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1da177e4 2/*
1da177e4
LT
3 * procfs-based user access to knfsd statistics
4 *
5 * /proc/net/rpc/nfsd
6 *
7 * Format:
8 * rc <hits> <misses> <nocache>
9 * Statistsics for the reply cache
1b76d1df 10 * fh <stale> <deprecated filehandle cache stats>
1da177e4 11 * statistics for filehandle lookup
70f23fd6 12 * io <bytes-read> <bytes-written>
1da177e4 13 * statistics for IO throughput
1b76d1df
AG
14 * th <threads> <deprecated thread usage histogram stats>
15 * number of threads
16 * ra <deprecated ra-cache stats>
17 *
1da177e4
LT
18 * plus generic RPC stats (see net/sunrpc/stats.c)
19 *
20 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <[email protected]>
21 */
22
1da177e4 23#include <linux/seq_file.h>
1da177e4 24#include <linux/module.h>
1da177e4 25#include <linux/sunrpc/stats.h>
246590f5 26#include <net/net_namespace.h>
1da177e4 27
9a74af21
BH
28#include "nfsd.h"
29
1da177e4
LT
30struct nfsd_stats nfsdstats;
31struct svc_stat nfsd_svcstats = {
32 .program = &nfsd_program,
33};
34
35static int nfsd_proc_show(struct seq_file *seq, void *v)
36{
37 int i;
38
1b76d1df 39 seq_printf(seq, "rc %u %u %u\nfh %u 0 0 0 0\nio %u %u\n",
1da177e4
LT
40 nfsdstats.rchits,
41 nfsdstats.rcmisses,
42 nfsdstats.rcnocache,
43 nfsdstats.fh_stale,
1da177e4
LT
44 nfsdstats.io_read,
45 nfsdstats.io_write);
1b76d1df 46
1da177e4 47 /* thread usage: */
1b76d1df
AG
48 seq_printf(seq, "th %u 0", nfsdstats.th_cnt);
49
50 /* deprecated thread usage histogram stats */
51 for (i = 0; i < 10; i++)
52 seq_puts(seq, " 0.000");
53
54 /* deprecated ra-cache stats */
55 seq_puts(seq, "\nra 0 0 0 0 0 0 0 0 0 0 0 0\n");
56
1da177e4
LT
57 /* show my rpc info */
58 svc_seq_show(seq, &nfsd_svcstats);
59
e2b20950
SA
60#ifdef CONFIG_NFSD_V4
61 /* Show count for individual nfsv4 operations */
62 /* Writing operation numbers 0 1 2 also for maintaining uniformity */
63 seq_printf(seq,"proc4ops %u", LAST_NFS4_OP + 1);
64 for (i = 0; i <= LAST_NFS4_OP; i++)
65 seq_printf(seq, " %u", nfsdstats.nfs4_opcount[i]);
66
67 seq_putc(seq, '\n');
68#endif
69
1da177e4
LT
70 return 0;
71}
72
73static int nfsd_proc_open(struct inode *inode, struct file *file)
74{
75 return single_open(file, nfsd_proc_show, NULL);
76}
77
97a32539
AD
78static const struct proc_ops nfsd_proc_ops = {
79 .proc_open = nfsd_proc_open,
80 .proc_read = seq_read,
81 .proc_lseek = seq_lseek,
82 .proc_release = single_release,
1da177e4
LT
83};
84
85void
86nfsd_stat_init(void)
87{
97a32539 88 svc_proc_register(&init_net, &nfsd_svcstats, &nfsd_proc_ops);
1da177e4
LT
89}
90
91void
92nfsd_stat_shutdown(void)
93{
246590f5 94 svc_proc_unregister(&init_net, "nfsd");
1da177e4 95}
This page took 1.104828 seconds and 4 git commands to generate.