xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/nfs/tst.call3.d (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * ASSERTION: Make sure nfsv3 provider probes are firing, and that the
29  * arguments are properly visible.
30  *
31  * SECTION: nfs3 provider
32  */
33 
34 #pragma D option destructive
35 #pragma D option quiet
36 
37 pid$1:a.out:waiting:entry
38 {
39 	this->value = (int *)alloca(sizeof (int));
40 	*this->value = 1;
41 	copyout(this->value, arg0, sizeof (int));
42 }
43 
44 nfsv3:::op-getattr-start
45 {
46 	printf("ci_local: %s\n", args[0]->ci_local);
47 	printf("ci_remote: %s\n", args[0]->ci_remote);
48 	printf("ci_protocol: %s\n", args[0]->ci_protocol);
49 
50 	printf("noi_xid: %d\n", args[1]->noi_xid);
51 	printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
52 	printf("noi_curpath: %s\n", args[1]->noi_curpath);
53 
54 	printf("fh3_flags: %d\n", args[2]->object.fh3_flags);
55 }
56 
57 nfsv3:::op-getattr-done
58 {
59 	printf("ci_local: %s\n", args[0]->ci_local);
60 	printf("ci_remote: %s\n", args[0]->ci_remote);
61 	printf("ci_protocol: %s\n", args[0]->ci_protocol);
62 
63 	printf("noi_xid: %d\n", args[1]->noi_xid);
64 	printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
65 	printf("noi_curpath: %s\n", args[1]->noi_curpath);
66 
67 	printf("status: %d\n", args[2]->status);
68 }
69 
70 nfsv3:::*-done
71 /seen[probename] == 0/
72 {
73 	++numberseen;
74 	seen[probename] = 1;
75 	printf("%d ops seen, latest op is %s\n", numberseen, probename);
76 }
77 
78 nfsv3:::*-done
79 /numberseen == 22/
80 {
81 	exit(0);
82 }
83 
84 tick-1s
85 /tick++ == 10/
86 {
87 	printf("%d nfsv3 ops seen; should be 22\n", numberseen);
88 	exit(1);
89 }
90