| 1 | |
| 2 | |
| 3 | *
|
| 4 | * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
|
| 5 | * Written by David Howells ([email protected])
|
| 6 |
|
| 7 |
|
| 8 | #include <linux/export.h>
|
| 9 | #include <linux/seq_file.h>
|
| 10 | #include "internal.h"
|
| 11 |
|
| 12 | atomic_t netfs_n_rh_dio_read;
|
| 13 | atomic_t netfs_n_rh_readahead;
|
| 14 | atomic_t netfs_n_rh_read_folio;
|
| 15 | atomic_t netfs_n_rh_read_single;
|
| 16 | atomic_t netfs_n_rh_rreq;
|
| 17 | atomic_t netfs_n_rh_sreq;
|
| 18 | atomic_t netfs_n_rh_download;
|
| 19 | atomic_t netfs_n_rh_download_done;
|
| 20 | atomic_t netfs_n_rh_download_failed;
|
| 21 | atomic_t netfs_n_rh_download_instead;
|
| 22 | atomic_t netfs_n_rh_read;
|
| 23 | atomic_t netfs_n_rh_read_done;
|
| 24 | atomic_t netfs_n_rh_read_failed;
|
| 25 | atomic_t netfs_n_rh_zero;
|
| 26 | atomic_t netfs_n_rh_short_read;
|
| 27 | atomic_t netfs_n_rh_write;
|
| 28 | atomic_t netfs_n_rh_write_begin;
|
| 29 | atomic_t netfs_n_rh_write_done;
|
| 30 | atomic_t netfs_n_rh_write_failed;
|
| 31 | atomic_t netfs_n_rh_write_zskip;
|
| 32 | atomic_t netfs_n_rh_retry_read_req;
|
| 33 | atomic_t netfs_n_rh_retry_read_subreq;
|
| 34 | atomic_t netfs_n_wh_buffered_write;
|
| 35 | atomic_t netfs_n_wh_dio_write;
|
| 36 | atomic_t netfs_n_wh_writepages;
|
| 37 | atomic_t netfs_n_wh_copy_to_cache;
|
| 38 | atomic_t netfs_n_wh_wstream_conflict;
|
| 39 | atomic_t netfs_n_wh_upload;
|
| 40 | atomic_t netfs_n_wh_upload_done;
|
| 41 | atomic_t netfs_n_wh_upload_failed;
|
| 42 | atomic_t netfs_n_wh_write;
|
| 43 | atomic_t netfs_n_wh_write_done;
|
| 44 | atomic_t netfs_n_wh_write_failed;
|
| 45 | atomic_t netfs_n_wh_retry_write_req;
|
| 46 | atomic_t netfs_n_wh_retry_write_subreq;
|
| 47 | atomic_t netfs_n_wb_lock_skip;
|
| 48 | atomic_t netfs_n_wb_lock_wait;
|
| 49 | atomic_t netfs_n_folioq;
|
| 50 |
|
| 51 | int netfs_stats_show(struct seq_file *m, void *v)
|
| 52 | {
|
| 53 | seq_printf(m, "Reads : DR=%u RA=%u RF=%u RS=%u WB=%u WBZ=%u\n",
|
| 54 | atomic_read(&netfs_n_rh_dio_read),
|
| 55 | atomic_read(&netfs_n_rh_readahead),
|
| 56 | atomic_read(&netfs_n_rh_read_folio),
|
| 57 | atomic_read(&netfs_n_rh_read_single),
|
| 58 | atomic_read(&netfs_n_rh_write_begin),
|
| 59 | atomic_read(&netfs_n_rh_write_zskip));
|
| 60 | seq_printf(m, "Writes : BW=%u DW=%u WP=%u 2C=%u\n",
|
| 61 | atomic_read(&netfs_n_wh_buffered_write),
|
| 62 | atomic_read(&netfs_n_wh_dio_write),
|
| 63 | atomic_read(&netfs_n_wh_writepages),
|
| 64 | atomic_read(&netfs_n_wh_copy_to_cache));
|
| 65 | seq_printf(m, "ZeroOps: ZR=%u sh=%u sk=%u\n",
|
| 66 | atomic_read(&netfs_n_rh_zero),
|
| 67 | atomic_read(&netfs_n_rh_short_read),
|
| 68 | atomic_read(&netfs_n_rh_write_zskip));
|
| 69 | seq_printf(m, "DownOps: DL=%u ds=%u df=%u di=%u\n",
|
| 70 | atomic_read(&netfs_n_rh_download),
|
| 71 | atomic_read(&netfs_n_rh_download_done),
|
| 72 | atomic_read(&netfs_n_rh_download_failed),
|
| 73 | atomic_read(&netfs_n_rh_download_instead));
|
| 74 | seq_printf(m, "CaRdOps: RD=%u rs=%u rf=%u\n",
|
| 75 | atomic_read(&netfs_n_rh_read),
|
| 76 | atomic_read(&netfs_n_rh_read_done),
|
| 77 | atomic_read(&netfs_n_rh_read_failed));
|
| 78 | seq_printf(m, "UpldOps: UL=%u us=%u uf=%u\n",
|
| 79 | atomic_read(&netfs_n_wh_upload),
|
| 80 | atomic_read(&netfs_n_wh_upload_done),
|
| 81 | atomic_read(&netfs_n_wh_upload_failed));
|
| 82 | seq_printf(m, "CaWrOps: WR=%u ws=%u wf=%u\n",
|
| 83 | atomic_read(&netfs_n_wh_write),
|
| 84 | atomic_read(&netfs_n_wh_write_done),
|
| 85 | atomic_read(&netfs_n_wh_write_failed));
|
| 86 | seq_printf(m, "Retries: rq=%u rs=%u wq=%u ws=%u\n",
|
| 87 | atomic_read(&netfs_n_rh_retry_read_req),
|
| 88 | atomic_read(&netfs_n_rh_retry_read_subreq),
|
| 89 | atomic_read(&netfs_n_wh_retry_write_req),
|
| 90 | atomic_read(&netfs_n_wh_retry_write_subreq));
|
| 91 | seq_printf(m, "Objs : rr=%u sr=%u foq=%u wsc=%u\n",
|
| 92 | atomic_read(&netfs_n_rh_rreq),
|
| 93 | atomic_read(&netfs_n_rh_sreq),
|
| 94 | atomic_read(&netfs_n_folioq),
|
| 95 | atomic_read(&netfs_n_wh_wstream_conflict));
|
| 96 | seq_printf(m, "WbLock : skip=%u wait=%u\n",
|
| 97 | atomic_read(&netfs_n_wb_lock_skip),
|
| 98 | atomic_read(&netfs_n_wb_lock_wait));
|
| 99 | return fscache_stats_show(m);
|
| 100 | }
|
| 101 | EXPORT_SYMBOL(netfs_stats_show);
|