summaryrefslogtreecommitdiffstats
path: root/cmd/arc_summary
Commit message (Collapse)AuthorAgeFilesLines
* Replace sysctl summary with tunables summary.Kyle Blatter2015-01-281-66/+57
| | | | | | | | | | | The original script displayed tunable parameters using sysctl calls. This patch modifies this by displaying tunable parameters found in /sys/modules/zfs/parameters/. modinfo calls are used to capture descriptions. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>
* Force all lines to be 80 columnsKyle Blatter2015-01-281-33/+66
| | | | | | | | | Ensure this script conforms to the projects style guidelines by limiting line length to 80 columns. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>
* Add a help option with usage informationKyle Blatter2015-01-281-4/+25
| | | | | | | | | | Add a basic help option and usage description which is consistent with arcstat.py and dbufstat.py. This also adds support for long opts. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>
* Refactor arc_summary to simplify -p processingKyle Blatter2015-01-281-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -p option is used to specify a specific page of output to be displayed. If omitted, all output pages would be displayed. arc_summary, as it stood, had really kludgy processing code for processing the -p option. It relied on a try-except block which was treated as an if statement and in normal operation would fail any time a user didn't specify the -p option on the command line. When the exception was thrown, the script would then display all output pages. This happened whether the -p option was omitted or malformed. Thus, in the principle use case, an exception would be raised in order to run the script as desired. The same except code would be called regardless of the exception, however, and malformed -p arguments would also cause the script to execute. Additionally, this required the function which handles the case where all output pages were to be displayed, _call_all, to be potentially called from several locations within main. This commit refactors the option processing code to simplify it and make it easier to catch runtime errors in the script. This is done by specializing the try-except block to only have an exception when the -p argument is malformed. When the -p option is correctly selected by the user, it calls a function in the unSub array directly, which will only display one page of output. Finally in the context of this refactoring the page breaks have been removed. Pages seem to have been added into the output in the FreeNAS version of the script. This patch removes pages from the output to more closely resemble the freebsd version of the script. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>
* Modified arc_summary.py to run on linuxcburroughs2015-01-281-287/+24
| | | | | | | | | | | | | 1) Comment out stat sections whose kstats are not currently available 2) Port most of arc_summary to use spl kstats 3) Enable l2arc stats 5) Include compressed l2size 4) Minor style fixes / cleanup Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: cburroughs <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>
* Add arc_summary.py from FreeNAScburroughs2015-01-282-0/+1378
The arc_summary script is a useful utility for administrators on other ZFS platforms. It provides a quick and easy way to get a high level view of the current ARC state. Historically this was a perl script but it was rewritten in python for FreeNAS. We've decided to adopt the python version instead of the perl version for a few reasons. 1) ZoL has no existing perl dependencies, but it does have a python dependency for scripts such as arcstat.py and dbufstat.py. Using python for arc_summary.py helps us minimize dependencies. 2) Most major Linux distributions already depend heavily on python for their core infrastructure. This means it's very likely to be available even very early in the boot process. Original source: https://github.com/freenas/freenas/blob/master/gui/tools/arc_summary.py Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: cburroughs <[email protected]> Signed-off-by: Kyle Blatter <[email protected]> Signed-off-by: Ned Bass <[email protected]>