xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/nfs/tst.call3.d (revision 3ce5372277f4657ad0e52d36c979527c4ca22de2)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * ASSERTION: Make sure nfsv3 provider probes are firing, and that the
31  * arguments are properly visible.
32  *
33  * SECTION: nfs3 provider
34  */
35 
36 #pragma D option destructive
37 #pragma D option quiet
38 
39 pid$1:a.out:waiting:entry
40 {
41 	this->value = (int *)alloca(sizeof (int));
42 	*this->value = 1;
43 	copyout(this->value, arg0, sizeof (int));
44 }
45 
46 nfsv3:::op-getattr-start
47 {
48 	printf("ci_local: %s\n", args[0]->ci_local);
49 	printf("ci_remote: %s\n", args[0]->ci_remote);
50 	printf("ci_protocol: %s\n", args[0]->ci_protocol);
51 
52 	printf("noi_xid: %d\n", args[1]->noi_xid);
53 	printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
54 	printf("noi_curpath: %s\n", args[1]->noi_curpath);
55 
56 	printf("fh3_flags: %d\n", args[2]->object.fh3_flags);
57 }
58 
59 nfsv3:::op-getattr-done
60 {
61 	printf("ci_local: %s\n", args[0]->ci_local);
62 	printf("ci_remote: %s\n", args[0]->ci_remote);
63 	printf("ci_protocol: %s\n", args[0]->ci_protocol);
64 
65 	printf("noi_xid: %d\n", args[1]->noi_xid);
66 	printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
67 	printf("noi_curpath: %s\n", args[1]->noi_curpath);
68 
69 	printf("status: %d\n", args[2]->status);
70 }
71 
72 nfsv3:::*-done
73 /seen[probename] == 0/
74 {
75 	++numberseen;
76 	seen[probename] = 1;
77 	printf("%d ops seen, latest op is %s\n", numberseen, probename);
78 }
79 
80 nfsv3:::*-done
81 /numberseen == 22/
82 {
83 	exit(0);
84 }
85 
86 tick-1s
87 /tick++ == 10/
88 {
89 	printf("%d nfsv3 ops seen; should be 22\n", numberseen);
90 	exit(1);
91 }
92