2020-11-03 14:32:41 +03:00
// 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 "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 ;
2020-09-22 13:06:07 +03:00
atomic_t netfs_n_rh_write_begin ;
2020-11-03 14:32:41 +03:00
atomic_t netfs_n_rh_write_done ;
atomic_t netfs_n_rh_write_failed ;
2020-09-22 13:06:07 +03:00
atomic_t netfs_n_rh_write_zskip ;
2022-02-09 22:52:13 +03:00
atomic_t netfs_n_wh_upload ;
atomic_t netfs_n_wh_upload_done ;
atomic_t netfs_n_wh_upload_failed ;
atomic_t netfs_n_wh_write ;
atomic_t netfs_n_wh_write_done ;
atomic_t netfs_n_wh_write_failed ;
2020-11-03 14:32:41 +03:00
2023-11-21 18:43:52 +03:00
int netfs_stats_show ( struct seq_file * m , void * v )
2020-11-03 14:32:41 +03:00
{
2023-11-21 18:43:52 +03:00
seq_printf ( m , " Netfs : RA=%u RP=%u WB=%u WBZ=%u rr=%u sr=%u \n " ,
2020-11-03 14:32:41 +03:00
atomic_read ( & netfs_n_rh_readahead ) ,
atomic_read ( & netfs_n_rh_readpage ) ,
2020-09-22 13:06:07 +03:00
atomic_read ( & netfs_n_rh_write_begin ) ,
atomic_read ( & netfs_n_rh_write_zskip ) ,
2020-11-03 14:32:41 +03:00
atomic_read ( & netfs_n_rh_rreq ) ,
atomic_read ( & netfs_n_rh_sreq ) ) ;
2023-11-21 18:43:52 +03:00
seq_printf ( m , " Netfs : ZR=%u sh=%u sk=%u \n " ,
2020-11-03 14:32:41 +03:00
atomic_read ( & netfs_n_rh_zero ) ,
2020-09-22 13:06:07 +03:00
atomic_read ( & netfs_n_rh_short_read ) ,
atomic_read ( & netfs_n_rh_write_zskip ) ) ;
2023-11-21 18:43:52 +03:00
seq_printf ( m , " Netfs : DL=%u ds=%u df=%u di=%u \n " ,
2020-11-03 14:32:41 +03:00
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 ) ) ;
2023-11-21 18:43:52 +03:00
seq_printf ( m , " Netfs : RD=%u rs=%u rf=%u \n " ,
2020-11-03 14:32:41 +03:00
atomic_read ( & netfs_n_rh_read ) ,
atomic_read ( & netfs_n_rh_read_done ) ,
atomic_read ( & netfs_n_rh_read_failed ) ) ;
2022-02-09 22:52:13 +03:00
seq_printf ( m , " Netfs : UL=%u us=%u uf=%u \n " ,
atomic_read ( & netfs_n_wh_upload ) ,
atomic_read ( & netfs_n_wh_upload_done ) ,
atomic_read ( & netfs_n_wh_upload_failed ) ) ;
2023-11-21 18:43:52 +03:00
seq_printf ( m , " Netfs : WR=%u ws=%u wf=%u \n " ,
2022-02-09 22:52:13 +03:00
atomic_read ( & netfs_n_wh_write ) ,
atomic_read ( & netfs_n_wh_write_done ) ,
atomic_read ( & netfs_n_wh_write_failed ) ) ;
2023-11-21 18:43:52 +03:00
return fscache_stats_show ( m ) ;
2020-11-03 14:32:41 +03:00
}
EXPORT_SYMBOL ( netfs_stats_show ) ;