Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for systemtap scripts #2036

Open
atoponce opened this issue Jan 9, 2014 · 4 comments
Open

Request for systemtap scripts #2036

atoponce opened this issue Jan 9, 2014 · 4 comments
Labels
Type: Feature Feature request or new feature

Comments

@atoponce
Copy link

atoponce commented Jan 9, 2014

I understand that @behlendorf has written some systemtap scripts for troubleshooting ZFS. How can I get these?

@chrisrd
Copy link
Contributor

chrisrd commented Jan 9, 2014

@atoponce The scripts are specific to what you want to investigate. The first step might be to use para-callgraph.stp from the systemtap distribution. This shows you functions called, along with their arguments and return values. It takes two parameters: a set of functions to monitor, and a function at which to start/stop the monitoring, e.g. to monitor all the functions in all the module/zfs/*.c files, starting when the zpl_xattr_list function is called:

# stap /usr/share/doc/systemtap/examples/general/para-callgraph.stp \
   'module("zfs").function("*@module/zfs/*.c")' \
   'module("zfs").function("zpl_xattr_list")' -c "getfattr -d aaaa"

For some examples, see #503, #1461. A search of the ZoL issues for stap or systemtap may also be useful:

https://github.com/zfsonlinux/zfs/search?q=stap&type=Issues
https://github.com/zfsonlinux/zfs/search?q=systemtap&type=Issues

Note: I'm no expert, what I know of systemtap I've learnt here!

@behlendorf
Copy link
Contributor

I think it would be great if there was a generic ZFS tapset for Systemtap. Alas all the scripts I've written in the past have been specific to troubleshooting an individual issue. Writing generic tools is considerably more involved although I'd love to see it happen.

Related to this we have been adding more kstats for increased visibility. You may find the following useful.

/proc/spl/kstat/zfs/rpool/io
/proc/spl/kstat/zfs/rpool/dmu_tx_assign
/proc/spl/kstat/zfs/rpool/txgs
/proc/spl/kstat/zfs/rpool/reads
/proc/spl/kstat/zfs/vdev_cache_stats
/proc/spl/kstat/zfs/zil
/proc/spl/kstat/zfs/arcstats
/proc/spl/kstat/zfs/dmu_tx
/proc/spl/kstat/zfs/zfetchstats
/proc/spl/kstat/zfs/dbufs
/proc/spl/kstat/zfs/xuio_stats
/proc/spl/kstat/zfs/fm

@atoponce
Copy link
Author

atoponce commented Jan 9, 2014

I know that scripts are written for very specific troubleshooting cases. Just looking to see what's out there, I guess, and where I can go. I'm just learning systemtap myself, so if I can help to contribute generic scripts, I will. Thanks.

@behlendorf behlendorf removed this from the 0.6.4 milestone Oct 30, 2014
@rlaager
Copy link
Member

rlaager commented Oct 1, 2016

This isn't directly related, but see also: https://github.com/iovisor/bcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

No branches or pull requests

4 participants