/usr/share/systemtap/examples/io
NameSizeModeActions
capture_ssl_master_secrets.meta6640644editdlrm
capture_ssl_master_secrets.stp10900755editdlrm
capture_ssl_master_secrets.txt19070644editdlrm
deviceseeks.meta4900644editdlrm
deviceseeks.stp12920755editdlrm
deviceseeks.txt53950644editdlrm
disktop.meta3810644editdlrm
disktop.stp17940755editdlrm
eatmydata.meta3370644editdlrm
eatmydata.stp11880755editdlrm
eatmydata.txt3040644editdlrm
enospc.meta3320644editdlrm
enospc.stp23180755editdlrm
inodewatch.meta4750644editdlrm
inodewatch.stp2450755editdlrm
inodewatch2.meta5040644editdlrm
inodewatch2.stp3900755editdlrm
ioblktime.meta7690644editdlrm
ioblktime.stp7880755editdlrm
iodevstats.meta7380644editdlrm
iodevstats.stp11520755editdlrm
iodevstats.txt5280644editdlrm
iostat-scsi.meta6080644editdlrm
iostat-scsi.stp43660755editdlrm
iostat-scsi.txt4810644editdlrm
iostats.meta6710644editdlrm
iostats.stp11540755editdlrm
iostats.txt3610644editdlrm
iotime.meta10240644editdlrm
iotime.stp28930755editdlrm
iotop.meta4100644editdlrm
iotop.stp6240755editdlrm
io_submit.meta5080644editdlrm
io_submit.stp19060755editdlrm
io_submit.tcl1400644editdlrm
mbrwatch.meta5590644editdlrm
mbrwatch.stp2340755editdlrm
mbrwatch.tcl1400644editdlrm
mbrwatch.txt7880644editdlrm
nfs_func_users.meta6650644editdlrm
nfs_func_users.stp3410755editdlrm
slowvfs.meta4260644editdlrm
slowvfs.stp2810755editdlrm
switchfile.meta3300644editdlrm
switchfile.stp2310644editdlrm
traceaio.c26240644editdlrm
traceaio.meta3310644editdlrm
traceaio.stp18250755editdlrm
traceaio.txt27610644editdlrm
traceio.meta4030644editdlrm
traceio.stp13840755editdlrm
traceio2.meta4000644editdlrm
traceio2.stp4940755editdlrm
ttyspy.meta5210644editdlrm
ttyspy.stp17500755editdlrm
ttyspy.txt4550644editdlrm
Edit: /usr/share/systemtap/examples/io/enospc.stp (2318B)
#!/usr/bin/stap // Enospc notification script // Copyright (C) 2012 Red Hat Inc., Lukas Czerner // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. // This tapset is used to watch for ENOSPC on file system operation, print // notification and send message to the syslog using logger. Supported file // systems so far are ext3, ext4, xfs and btrfs /* * Print the warning message to the stdout and send it * to the syslog via logger. */ function warnlog(fsname:string, dev:long) { message = sprintf("%s (%d, %d) - no space left on the file system (uid: %d, %s:%d)\n", fsname, MAJOR(dev), MINOR(dev), uid(), execname(), pid()); /* Print the message to the output */ printf("[%s]: %s", ctime(gettimeofday_s()), message); /* Log the message with logger */ command = sprintf("/usr/bin/logger '%s'", message); system(command); } /* Catch ENOSPC in ext4 file system */ probe {kernel,module("ext4")}.function("ext4_should_retry_alloc").return ? { if (0 == $return) warnlog("ext4", @entry($sb->s_dev)); } /* Catch ENOSPC in ext3 file system */ probe {kernel,module("ext3")}.function("ext3_should_retry_alloc").return ? { if (0 == $return) warnlog("ext3", @entry($sb->s_dev)); } /* Catch ENOSPC in xfs file system on write */ probe {kernel,module("xfs")}.function("xfs_file_aio_write").return ? { if (-28 == $return) warnlog("xfs", @entry($iocb->ki_filp->f_mapping->host->i_sb->s_dev)); } /* Catch ENOSPC in xfs file system on inode creation */ probe {kernel,module("xfs")}.function("xfs_vn_mknod").return ? { if (-28 == $return) warnlog("xfs", @entry($dir->i_sb->s_dev)); } /* Catch ENOSPC in xfs file system on fallocate */ probe {kernel,module("xfs")}.function("xfs_vn_fallocate").return ? { if (-28 == $return) warnlog("xfs", @entry($inode->i_sb->s_dev)); } /* Catch ENOSPC in btrfs file system */ probe {kernel,module("btrfs")}.function("btrfs_check_data_free_space").return ? { if (-28 == $return) warnlog("btrfs", (@defined(@entry($inode->root))? @entry($inode->root->fs_info->sb->s_dev): @entry($inode->i_sb->s_dev))); }