forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gather statistics from the netfs interface that can be exported through a seqfile. This is intended to be called by a later patch when viewing /proc/fs/fscache/stats. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-and-tested-by: Jeff Layton <jlayton@kernel.org> Tested-by: Dave Wysochanski <dwysocha@redhat.com> Tested-By: Marc Dionne <marc.dionne@auristor.com> cc: Matthew Wilcox <willy@infradead.org> cc: linux-mm@kvack.org cc: linux-cachefs@redhat.com cc: linux-afs@lists.infradead.org cc: linux-nfs@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: v9fs-developer@lists.sourceforge.net cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/161118139247.1232039.10556850937548511068.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/161161034669.2537118.2761232524997091480.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/161340397101.1303470.17581910581108378458.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/161539539959.286939.6794352576462965914.stgit@warthog.procyon.org.uk/ # v4 Link: https://lore.kernel.org/r/161653797700.2770958.5801990354413178228.stgit@warthog.procyon.org.uk/ # v5 Link: https://lore.kernel.org/r/161789079281.6155.17141344853277186500.stgit@warthog.procyon.org.uk/ # v6
- Loading branch information
Showing
6 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
netfs-y := \ | ||
read_helper.o | ||
netfs-y := read_helper.o stats.o | ||
|
||
obj-$(CONFIG_NETFS_SUPPORT) := netfs.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* Netfs support statistics | ||
* | ||
* Copyright (C) 2021 Red Hat, Inc. All Rights Reserved. | ||
* Written by David Howells (dhowells@redhat.com) | ||
*/ | ||
|
||
#include <linux/export.h> | ||
#include <linux/seq_file.h> | ||
#include <linux/netfs.h> | ||
#include "internal.h" | ||
|
||
atomic_t netfs_n_rh_readahead; | ||
atomic_t netfs_n_rh_readpage; | ||
atomic_t netfs_n_rh_rreq; | ||
atomic_t netfs_n_rh_sreq; | ||
atomic_t netfs_n_rh_download; | ||
atomic_t netfs_n_rh_download_done; | ||
atomic_t netfs_n_rh_download_failed; | ||
atomic_t netfs_n_rh_download_instead; | ||
atomic_t netfs_n_rh_read; | ||
atomic_t netfs_n_rh_read_done; | ||
atomic_t netfs_n_rh_read_failed; | ||
atomic_t netfs_n_rh_zero; | ||
atomic_t netfs_n_rh_short_read; | ||
atomic_t netfs_n_rh_write; | ||
atomic_t netfs_n_rh_write_done; | ||
atomic_t netfs_n_rh_write_failed; | ||
|
||
void netfs_stats_show(struct seq_file *m) | ||
{ | ||
seq_printf(m, "RdHelp : RA=%u RP=%u rr=%u sr=%u\n", | ||
atomic_read(&netfs_n_rh_readahead), | ||
atomic_read(&netfs_n_rh_readpage), | ||
atomic_read(&netfs_n_rh_rreq), | ||
atomic_read(&netfs_n_rh_sreq)); | ||
seq_printf(m, "RdHelp : ZR=%u sh=%u\n", | ||
atomic_read(&netfs_n_rh_zero), | ||
atomic_read(&netfs_n_rh_short_read)); | ||
seq_printf(m, "RdHelp : DL=%u ds=%u df=%u di=%u\n", | ||
atomic_read(&netfs_n_rh_download), | ||
atomic_read(&netfs_n_rh_download_done), | ||
atomic_read(&netfs_n_rh_download_failed), | ||
atomic_read(&netfs_n_rh_download_instead)); | ||
seq_printf(m, "RdHelp : RD=%u rs=%u rf=%u\n", | ||
atomic_read(&netfs_n_rh_read), | ||
atomic_read(&netfs_n_rh_read_done), | ||
atomic_read(&netfs_n_rh_read_failed)); | ||
seq_printf(m, "RdHelp : WR=%u ws=%u wf=%u\n", | ||
atomic_read(&netfs_n_rh_write), | ||
atomic_read(&netfs_n_rh_write_done), | ||
atomic_read(&netfs_n_rh_write_failed)); | ||
} | ||
EXPORT_SYMBOL(netfs_stats_show); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters