I'm trying to prove that I've fixed a bug and I happen to know that if a certain function returns an error code, then I might have hit the code in question. How do I quickly determine whether or not I have hit such a case?
[root@pnfs-3-11 ~/dtrace]> more mms.d
#! /usr/sbin/dtrace -Fs
:nfs:nfs4_trigger_mount:return
/args[1] != 0/
{
printf("rc1 = %d\n", args[1]);
}
:nfs:nfs4_ephemeral_umount:return
/args[1] != 0/
{
printf("rc1 = %d\n", args[1]);
}
[root@pnfs-3-11 ~/dtrace]> ./mms.d
dtrace: script './mms.d' matched 2 probes
CPU FUNCTION
0 <- nfs4_ephemeral_umount rc1 = 16
0 <- nfs4_ephemeral_umount rc1 = 16
So if the function name is nfs4_trigger_mount or nfs4_ephemeral_umount, then print the return code if it is not 0. Hmm, I should probably remove the '\n's.
[root@pnfs-3-11 ~/dtrace]> ./mms.d dtrace: script './mms.d' matched 2 probes CPU FUNCTION 1 <- nfs4_ephemeral_umount rc1 = 16 1 <- nfs4_ephemeral_umount rc1 = 16
I'm actually looking for an 11 (EAGAIN) coming back from nfs4_trigger_mount, but the abundance of 16 (EBUSY) from nfs4_ephemeral_umount tells me I've probably fixed another bug I was hitting.