summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* nfsiostat: display NFS RPC queue time for mountstats and nfs-iostatRyan Doyle2017-10-303-5/+22
| | | | | | | | | Display the NFS queue statistics for mountstats and nfsiostat exported in /proc/self/mountstats. The RTT and total execution time is currently displayed but it's also useful displaying how long the task was queued for too Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: avoid parsing "no device mounted ..." lineManjunath Patil2017-10-051-0/+2
| | | | | | | | | | Present nfsiostat includes the "no device mounted ..." line from /proc/self/mountstats as addition description of the preceding mount point. If the preceding mount point is NFS mountpoint, nfsiostat fails to parse this line eventually. This patch avoids parsing this line. Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Remove a shebangSteve Dickson2017-07-271-1/+1
| | | | | | | There might be an issue that the script is executed with unwanted version of <lang>. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcdebug.c: remove a warningSteve Dickson2017-07-261-1/+2
| | | | | | rpcdebug.c:77:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: add pNFS READs and WRITEsScott Mayhew2016-09-221-0/+2
| | | | | | | | | These counters are already in /proc/self/mountstats but the mountstats program doesn't display them. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1377740
* mountstats: add missing v4.2 operationsScott Mayhew2015-12-111-1/+8
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: handle KeyError in accumulate_iostats()Scott Mayhew2015-12-111-1/+4
| | | | | | | | | | | | | | | | | | | | | This will prevent a backtrace like this from occurring in 'mountstats nfsstat' if a new NFSv4 operation is added to the kernel but not to the Nfsv4ops list in mountstats.py: Traceback (most recent call last): File "/sbin/mountstats", line 988, in <module> res = main() File "/sbin/mountstats", line 977, in main return args.func(args) File "/sbin/mountstats", line 792, in nfsstat_command v4stats.accumulate_iostats(acc_stats) File "/sbin/mountstats", line 566, in accumulate_iostats self.__rpc_data[op] = list(map(add, self.__rpc_data[op], new_stats.__rpc_data[op])) KeyError: 'SEEK' Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats.man: Remove a few bogus .R macrosScott Mayhew2015-09-161-4/+4
| | | | | | | | | | These have no effect on the rendering of the man page, but they do cause the following error if you try to pipe or redirect the output: `R' is a string (producing the registered sign), not a macro. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats.man: fixed typo in man pageSteve Dickson2015-08-101-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix the retrans counter output by the nfsstat commandScott Mayhew2015-06-031-1/+1
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Normalize the mountpoints passed on the command line.Scott Mayhew2015-03-041-3/+3
| | | | | | | | Normalize the mountpoints passed on the command line so that commands like 'mountstats /mnt/' succeed rather than fail. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix exit code handlingScott Mayhew2015-03-041-4/+7
| | | | | | | | | | | When I changed mountstats to use the argparse module, I neglected to make the subcommand functions return any values even though main() was looking for them. Also removed SystemExit from the except clause at the end of the program since it was causing the program to always exit with a status of 1. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed a few typos in the mountstats(8) manpageSteve Dickson2015-02-191-4/+4
| | | | | Acked-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Updated the mountstats(8) man page.Scott Mayhew2014-12-131-14/+128
| | | | | | | | Added documentation for the iostat and nfsstat sub-commands. Added documentation for all of the options that have recently been added. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Implement the nfsstat sub-commandScott Mayhew2014-12-131-3/+153
| | | | | | | Displays nfssstat-like statistics (client statistics only). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -R/--raw to mountstats_commandScott Mayhew2014-12-131-4/+43
| | | | | | | | | This option displays the mountstats in raw format (i.e. in the same format as /proc/self/mountstats). It's intended to be used mainly with the -S/--since option. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Allow mountstats_command to take a variable number of mountpointsScott Mayhew2014-12-131-14/+34
| | | | | | | | | Allow the mountstats command to take a variable number of mountpoints (including none, in which case it will print stats for all NFS mountpoints it finds). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix IndexError in __parse_nfs_lineScott Mayhew2014-12-131-2/+2
| | | | | | | | If __parse_nfs_line is is called on a line that has 'fstype nfsd', it'll raise an IndexError trying to parse a nonexistent statvers entry. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -S/--sinceScott Mayhew2014-12-131-13/+38
| | | | | | | | | | Add support for -S/--since to display the delta between a previous copy of /proc/self/mountstats and the current /proc/self/mountstats file. Can be combined with the -f option to show the statistics between two different points in time. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -f/--fileScott Mayhew2014-12-131-10/+21
| | | | | | | | Add support for the -f/--file option to allow parsing of data from an arbitrary file instead of /proc/self/mountstats. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make print_iostat_summary handle newly appearing mountsScott Mayhew2014-12-131-1/+1
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make the iostat sub-command output match that of nfs-iostat.pyScott Mayhew2014-12-131-43/+61
| | | | | | | Changes mostly lifted straight from nfs-iostat.py. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Convert existing option parsing to use the argparse moduleScott Mayhew2014-12-131-144/+110
| | | | | | | | | | | | | | Made mountstats, nfsstat, and iostat all subcommands (note that the nfsstat function is still unimplemented here). If no sub-command is given, then the mountstats sub-command will run by default (so any scripts that run older versions of the mountstats command will still work). Also removed the --start and --end options since all they do is throw exceptions. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor compare_iostatsScott Mayhew2014-12-131-6/+19
| | | | | | | | | | Iterate over the newly added counters instead of using repeated assignment statements. Also compute the difference of every counter where it makes sense -- this will allow support for -S/--since to be implemented in the future. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor __parse_nfs_line and __parse_rpc_lineScott Mayhew2014-12-131-69/+23
| | | | | | | | Iterate over the newly added counter lists instead of having a ton of assignment statements. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add lists of various countersScott Mayhew2014-12-131-0/+168
| | | | | | | | | | The NfsEventCounters and NfsByteCounters were lifted straight from nfs-iostat.py. Also added counters for the xprt line (for udp, tcp, and rdma) as well as for v3 and v4 NFS ops. These will allow for more compact code in a couple of places. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix up NFS event countersScott Mayhew2014-12-131-15/+18
| | | | | | | | | The event counters in the mountstats program aren't in sync with the event counters in the kernel. Removed syncinodes and added vfsupdatepage, vfssetattr, congestionwait, pnfsreads, and pnfswrites. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcgen: change internal rpcgen to support separate builddirDavid Hardeman2014-12-081-3/+4
| | | | | | | | rpcgen uses absolute paths (based on the input) when generating the output files, thus breaking builds using a separate build directory. Signed-off-by: David Hardeman <david@hardeman.nu> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Sort RPC statistics by operation countChuck Lever2014-12-061-11/+14
| | | | | | | | | Sort the RPC statistics in descending order by operation count, so that the most frequently executed operation appears at the top of the listing (a la `top`). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix spurious I/O errorsChuck Lever2014-11-171-0/+4
| | | | | | | | | | | | | | | | | When running mountstats under "watch," occassionally the output shows "close failed in file object desctructor: sys.excepthook is missing" and the data display is messed up. This seems to be a common problem when Python script output is piped to another program. Ensure stdout/stderr is completely flushed before mountstats exits, and add an IOError exception handler to catch these exceptions gracefully. Solution suggested by: http://bugs.python.org/issue11380 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Don't display retrans stats unless there are re-xmitSigned-off-by: Chuck Lever2014-11-041-2/+5
| | | | | | | | Clean up display of RPC statistics by omitting retransmit statistics when there have been no retransmissions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Include libgen.h for basenameNatanael Copa2014-09-151-0/+1
| | | | | | | | | | According POSIX basename(3) should have an #include <libgen.h> There are a different GNU implementation too, that can be used with _GNU_SOURCE, but the POSIX version is good enough and more portable. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix Python 3 compatibility of mountstats and nfs-iostatSlavek Kabrda2014-07-252-2/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: Document the output columns in the manpageJan Chaloupka2014-06-171-0/+55
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat: Fix attribute cache statisticsChuck Lever2014-04-301-20/+8
| | | | | | | | "nfs-iostat.py --attr" was displaying nonsense (like negative counts and percentages). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat: Fix columnarization of RPC statisticsChuck Lever2014-04-301-12/+19
| | | | | | Note: format() is new with Python 2.6 Signed-off-by: Steve Dickson <steved@redhat.com>
* tools: use install -m instead of --modeAaro Koskinen2014-03-112-2/+2
| | | | | | | | Use install -m instead of--mode for better compatibility. E.g. busybox's install doesn't support the long option. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: fix python2.x supportWeston Andros Adamson2013-10-211-0/+2
| | | | | | | | | Commit b703eabe converted mountstats to using python3's print() function, but this doesn't work in python2.x without importing the print function from __future__. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat: Make Python 3 compatibleBohuslav Kabrda2013-09-181-11/+11
| | | | | | | This will make nfs-iostat run on Python 2.6, 2.7 and >= 3.0 Signed-off-by: Bohuslav Kabrda <bkabrda@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make mountstats Python 3 compatibleBohuslav Kabrda2013-09-181-155/+155
| | | | | | | This will make mountstat run on Python 2.6, 2.7 and >= 3.0 Signed-off-by: Bohuslav Kabrda <bkabrda@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: periodically flush stdoutHarshula Jayasuriya2013-09-181-0/+2
| | | | | | | | | | In a shell script, when nfsiostat is run in the background with stdout redirected to a file, flush stdout periodically to ensure that we do not lose the buffered output if the nfsiostat process is killed. Signed-off-by: Harshula Jayasuriya <harshula@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: restore output formatWeston Andros Adamson2013-07-011-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes to support python 3 changed the output of nfsiostat from: read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) 48.094 2889.133 60.072 0 (0.0%) 177.160 184.833 ... to: read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) 0.000 0.000 0.000 0 (0.0%) 0.000 0.000 ... Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcdebug: do not use build toolchainMike Frysinger2013-03-251-6/+0
| | | | | | | | | The rpcdebug program gets installed, so we don't want to use the build toolchain to compile it. I can't find any scripts in the build system that try to execute it, so this shouldn't be a problem. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: make it work w/python3Mike Frysinger2013-03-251-64/+66
| | | | | | | | | | | Simple fixes here to work with python 2 & 3: - use print() everywhere - dict.iteritems() -> dict.items() - file() -> open() - sys.maxint -> sys.maxsize Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcdebug: Add new "state" flag for the nfs moduleChuck Lever2012-06-191-0/+1
| | | | | | | | Kernel 3.5 adds a debugging flag for showing NFS client debugging messages having to do with NFSv4 state operations. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* autoconf: only link binaries that need it to libtirpcJeff Layton2012-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is essentially the same as the previous version, but has been respun to fix up some merge conflicts with some of Chuck's recent changes. When we first added tirpc support, we took a "big hammer" approach, and had it add libtirpc to $LIBS. That had the effect of making it so that that library was linked into every binary. That's unnecessary, and wasteful with memory. Don't let AC_CHECK_LIB add -ltirpc to $LIBS. Instead, have the autoconf tests set $(LIBTIRPC) in the makefiles, and have the programs that need it explicitly include that library. In the event that we're not using libtirpc, then set $LIBTIRPC to a blank string. This necessitates a change to the bindresvport_sa check too. Since that library is no longer included in $LIBS, we need to convert that check to use AC_CHECK_LIB instead of AC_CHECK_FUNCS. This patch also fixes a subtle bug. If the library was usable, but the includes were not, the test would set $enable_tirpc to "no", but HAVE_LIBTIRPC would still be true. That configuration would likely fail to build. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcdebug: Add missing debug flagsSteve Dickson2011-10-201-0/+3
| | | | | | | | | | This patch added the following debug flags: fscache - enable FSCache debugging pnfs - enable general pNFS debugging pnfs_ld - enable pNFS layout debugging Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Breaks on 3.1 kernelsSteve Dickson2011-09-211-0/+9
| | | | | | | | | mountstats depend on all devices entries in /proc/self/mountstats to start with the word 'device'. With 3.1 kernels, NFS entries start with the actual device (i.e. server:/export) not the word 'device'. This change confused mountstats parsing. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: Breaks on 3.1 kernelsSteve Dickson2011-09-211-2/+9
| | | | | | | | | nfsiostat depend on all devices entries in /proc/self/mountstats to start with the word 'device'. With 3.1 kernels, NFS entries start with the actual device (i.e. server:/export) not the word 'device'. This change confused nfsiostat parsing. Signed-off-by: Steve Dickson <steved@redhat.com>
* pdate addres for Free Software FoundationNeilBrown2011-08-292-2/+4
| | | | | | | | | | | | License texts contain multiple address for FSF, some wrong. So update them and replace COPYING file with http://www.gnu.org/licenses/gpl-2.0.txt which has a few changes to preamble and commentary. Also remove extra COPYING file from utils/statd/ Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>