bpftrace script to monitor tasks that are stuck in NFSv4 exception loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



See attachment.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx


#!/usr/bin/bpftrace
/*
 * Monitor NFSv4 exceptions
 *
 * Copyright 2023 Trond Myklebust
 * Licensed under the GPLv2
 *
 */
struct nfs4_exception {
	struct nfs4_state *state;
	struct inode *inode;
	struct nfs4_stateid_struct *stateid;
	long timeout;
	unsigned short retrans;
	unsigned char task_is_privileged : 1;
	unsigned char delay : 1,
		      recovering : 1,
		      retry : 1;
	bool interruptible;
};

kprobe:nfs4_do_handle_exception {
	$server = (struct nfs_server *)arg0;
	$errorcode = (int32)arg1;
	$exception = (struct nfs4_exception *)arg2;
	$inode = $exception->inode;

	if ($errorcode != 0 && $inode != 0) {
		$dev = (uint32)$inode->i_sb->s_dev;
		printf("%s [%d]: inode=%u:%u:%u, error=%d %s\n",
		       strftime("%F %H:%M:%S", nsecs), pid, $dev >> 20,
		       $dev & ((1 << 20) - 1), $inode->i_ino, $errorcode,
		       kstack());
	}
}

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux