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