Commit Graph

10 Commits

Author SHA1 Message Date
Isaac Huang
312f82ce65 sighandler() should take 2 arguments
Stopping arcstat.py with ^C always ends up with error:
TypeError: sighandler() takes no arguments (2 given)

Since no special signal handling was done in sighandler(),
it's simpler to just set SIGINT handler to SIG_DFL, which
terminates the script.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Isaac Huang <he.huang@intel.com>
Closes #2179
2014-03-20 11:03:46 -07:00
Brian Behlendorf
d9119bd66d Revert "sighandler() should take 2 arguments"
This reverts commit 0bb89b6c59 in
favor of a cleaner implementation.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2182
2014-03-20 11:03:21 -07:00
Isaac Huang
0bb89b6c59 sighandler() should take 2 arguments
Stopping arcstat.py with ^C always ends up with error:

  TypeError: sighandler() takes no arguments (2 given)

This patch corrects the error by updating the signal handler
to take the correct number of arguments.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2182
2014-03-12 09:00:18 -07:00
Isaac Huang
4e1c9f9c48 Make arcstat.py default to one header per screen
Today arcstat.py prints one header every hdr_intr (20 by default)
lines. It would be more consistent with out utilities like vmstat
if hdr_intr defaulted to terminal window size, i.e.  one header
per screenful of outputs.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2183
2014-03-12 08:56:12 -07:00
cburroughs
e78b6da3d0 Include l2asize in arcstat
For consistency with upstream pull in the l2asize update after
reworking it from Perl to Python.

References:
  https://github.com/mharsch/arcstat/pull/11
  https://github.com/mharsch/arcstat/pull/12

Signed-off-by: cburroughs <chris.burroughs@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2122
2014-03-04 11:25:58 -08:00
Matthew Thode
09d672d331 Python 3 fixes
Future proofing for compatibility with newer versions of Python.

Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1838
2013-11-08 14:30:29 -08:00
Matthew Thode
23bc1f91fc pep8 code readability changes
Update the code to follow the pep8 style guide.

References:
  http://www.python.org/dev/peps/pep-0008/

Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1838
2013-11-08 14:30:22 -08:00
Brian Behlendorf
d738d34da5 Add dbufstat.py command
The dbufstat.py command was added to provide a conveniant way to
easily determine what ZFS is caching.  The script consumes the
raw /proc/spl/kstat/zfs/dbufs kstat data can consolidates it in
to a more human readable form.  This was designed primarily as
a tool to aid developers but it may also be useful for advanced
users who want more visibility in to what the ARC is caching.

When run without options dbufstat.py will default to showing a
list of all objects with at least one buffer present in the
cache.  The total cache space consumed by that object will be
printed on the right along with the object type.  Similar to the
arcstats.py command the -x option may used to display additional
fields.

Two other modes of operation are also supported by dbufstat.py
and the expectation is additional display modes may be added as
needed.  The -t option will summerize the total number of bytes
cached for each object type, and the -b option will show every
dbuf currently cached.

The script was designed to be consistent with arcstat.py and
includes most of the same options and funcationality.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2013-10-25 14:52:45 -07:00
Christ Schlacta
fb02fabf9b Modified arcstat.py to run on linux
* Modified kstat_update() to read arcstats from proc.
* Fix shebang.
* Added Makefile.am entries for arcstat.py

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1506
2013-06-18 15:43:15 -07:00
Christ Schlacta
7634cd54db Added arcstat.py from FreeNAS
Original source:
  http://support.freenas.org/browser/nanobsd/Files/usr/local/bin/arcstat.py

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1506
2013-06-18 15:30:08 -07:00