xref: /titanic_50/usr/src/cmd/smbsrv/dtrace/smbnode.d (revision 69b3e10436272b0970d58743de375d0dd61046ce)
1 #!/usr/sbin/dtrace -qs
2 /*
3  * CDDL HEADER START
4  *
5  * The contents of this file are subject to the terms of the
6  * Common Development and Distribution License (the "License").
7  * You may not use this file except in compliance with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2007 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 BEGIN
30 {
31     printf("-->SMB Server Node Trace Started");
32     printf("\n\n");
33 }
34 
35 END
36 {
37     printf("<--SMB Server Node Trace Ended");
38     printf("\n\n");
39 }
40 
41 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
42 /((smb_node_t *)arg0)->n_state == SMB_NODE_STATE_AVAILABLE/
43 {
44     printf("\nSMB Node lookup hit/SMB_NODE_STATE_AVAILABLE");
45     printf("\n\tNode: %p", arg0);
46     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
47     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
48     stack();
49 }
50 
51 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
52 /((smb_node_t *)arg0)->n_state == SMB_NODE_STATE_DESTROYING/
53 {
54     printf("\nSMB Node lookup hit/SMB_NODE_STATE_DESTROYING");
55     printf("\n\tNode: %p", arg0);
56     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
57     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
58     stack();
59 }
60 
61 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
62 /(((smb_node_t *)arg0)->n_state != SMB_NODE_STATE_DESTROYING) &&
63  (((smb_node_t *)arg0)->n_state != SMB_NODE_STATE_AVAILABLE)/
64 {
65     printf("\nSMB Node lookup hit/Unknown State");
66     printf("\n\tNode: %p", arg0);
67     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
68     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
69     stack();
70 }
71 
72 sdt:smbsrv:smb_node_lookup:smb_node_lookup_miss
73 {
74     printf("\nSMB Node lookup miss");
75     printf("\n\tNode: %p", arg0);
76     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
77     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
78     stack();
79 }
80 
81 sdt:smbsrv:smb_node_ref:smb_node_ref_exit
82 {
83     printf("\nSMB Node reference taken");
84     printf("\n\tNode: %p", arg0);
85     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
86     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
87     stack();
88 }
89 
90 sdt:smbsrv:smb_node_release:smb_node_release
91 /((smb_node_t *)arg0)->n_refcnt == 1/
92 {
93     printf("\nSMB Node release(will be destroyed)");
94     printf("\n\tNode: %p", arg0);
95     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
96     stack();
97 }
98 
99 sdt:smbsrv:smb_node_release:smb_node_release
100 /((smb_node_t *)arg0)->n_refcnt > 1/
101 {
102     printf("\nSMB Node release");
103     printf("\n\tNode: %p", arg0);
104     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
105     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
106     stack();
107 }
108 
109 sdt:smbsrv:smb_node_delete_on_close:smb_node_delete_on_close
110 /(int)arg0 == 0/
111 {
112     printf("\nSMB Node delete on close successful");
113     printf("\n\tNode: %p", arg1);
114     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg1)->vp)->v_path);
115     stack();
116 }
117 
118 sdt:smbsrv:smb_node_delete_on_close:smb_node_delete_on_close
119 /(int)arg0 == 0/
120 {
121     printf("\nSMB Node delete on close failed (%d)", (int)arg0);
122     printf("\n\tNode: %p", arg1);
123     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg1)->vp)->v_path);
124     stack();
125 }
126 
127 
128