stats.c (1953B)
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> 10#include "internal.h" 11 12atomic_t netfs_n_rh_readahead; 13atomic_t netfs_n_rh_readpage; 14atomic_t netfs_n_rh_rreq; 15atomic_t netfs_n_rh_sreq; 16atomic_t netfs_n_rh_download; 17atomic_t netfs_n_rh_download_done; 18atomic_t netfs_n_rh_download_failed; 19atomic_t netfs_n_rh_download_instead; 20atomic_t netfs_n_rh_read; 21atomic_t netfs_n_rh_read_done; 22atomic_t netfs_n_rh_read_failed; 23atomic_t netfs_n_rh_zero; 24atomic_t netfs_n_rh_short_read; 25atomic_t netfs_n_rh_write; 26atomic_t netfs_n_rh_write_begin; 27atomic_t netfs_n_rh_write_done; 28atomic_t netfs_n_rh_write_failed; 29atomic_t netfs_n_rh_write_zskip; 30 31void netfs_stats_show(struct seq_file *m) 32{ 33 seq_printf(m, "RdHelp : RA=%u RP=%u WB=%u WBZ=%u rr=%u sr=%u\n", 34 atomic_read(&netfs_n_rh_readahead), 35 atomic_read(&netfs_n_rh_readpage), 36 atomic_read(&netfs_n_rh_write_begin), 37 atomic_read(&netfs_n_rh_write_zskip), 38 atomic_read(&netfs_n_rh_rreq), 39 atomic_read(&netfs_n_rh_sreq)); 40 seq_printf(m, "RdHelp : ZR=%u sh=%u sk=%u\n", 41 atomic_read(&netfs_n_rh_zero), 42 atomic_read(&netfs_n_rh_short_read), 43 atomic_read(&netfs_n_rh_write_zskip)); 44 seq_printf(m, "RdHelp : DL=%u ds=%u df=%u di=%u\n", 45 atomic_read(&netfs_n_rh_download), 46 atomic_read(&netfs_n_rh_download_done), 47 atomic_read(&netfs_n_rh_download_failed), 48 atomic_read(&netfs_n_rh_download_instead)); 49 seq_printf(m, "RdHelp : RD=%u rs=%u rf=%u\n", 50 atomic_read(&netfs_n_rh_read), 51 atomic_read(&netfs_n_rh_read_done), 52 atomic_read(&netfs_n_rh_read_failed)); 53 seq_printf(m, "RdHelp : WR=%u ws=%u wf=%u\n", 54 atomic_read(&netfs_n_rh_write), 55 atomic_read(&netfs_n_rh_write_done), 56 atomic_read(&netfs_n_rh_write_failed)); 57} 58EXPORT_SYMBOL(netfs_stats_show);