xref: /illumos-gate/usr/src/cmd/smbsrv/dtrace/smbnode.d (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
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 BEGIN
28 {
29     printf("-->SMB Server Node Trace Started");
30     printf("\n\n");
31 }
32 
33 END
34 {
35     printf("<--SMB Server Node Trace Ended");
36     printf("\n\n");
37 }
38 
39 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
40 /((smb_node_t *)arg0)->n_state == SMB_NODE_STATE_AVAILABLE/
41 {
42     printf("\nSMB Node lookup hit/SMB_NODE_STATE_AVAILABLE");
43     printf("\n\tNode: %p", arg0);
44     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
45     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
46     stack();
47 }
48 
49 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
50 /((smb_node_t *)arg0)->n_state == SMB_NODE_STATE_DESTROYING/
51 {
52     printf("\nSMB Node lookup hit/SMB_NODE_STATE_DESTROYING");
53     printf("\n\tNode: %p", arg0);
54     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
55     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
56     stack();
57 }
58 
59 sdt:smbsrv:smb_node_lookup:smb_node_lookup_hit
60 /(((smb_node_t *)arg0)->n_state != SMB_NODE_STATE_DESTROYING) &&
61  (((smb_node_t *)arg0)->n_state != SMB_NODE_STATE_AVAILABLE)/
62 {
63     printf("\nSMB Node lookup hit/Unknown State");
64     printf("\n\tNode: %p", arg0);
65     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
66     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
67     stack();
68 }
69 
70 sdt:smbsrv:smb_node_lookup:smb_node_lookup_miss
71 {
72     printf("\nSMB Node lookup miss");
73     printf("\n\tNode: %p", arg0);
74     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
75     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
76     stack();
77 }
78 
79 sdt:smbsrv:smb_node_ref:smb_node_ref_exit
80 {
81     printf("\nSMB Node reference taken");
82     printf("\n\tNode: %p", arg0);
83     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
84     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
85     stack();
86 }
87 
88 sdt:smbsrv:smb_node_release:smb_node_release
89 /((smb_node_t *)arg0)->n_refcnt == 1/
90 {
91     printf("\nSMB Node release(will be destroyed)");
92     printf("\n\tNode: %p", arg0);
93     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
94     stack();
95 }
96 
97 sdt:smbsrv:smb_node_release:smb_node_release
98 /((smb_node_t *)arg0)->n_refcnt > 1/
99 {
100     printf("\nSMB Node release");
101     printf("\n\tNode: %p", arg0);
102     printf("\n\tRefCnt: %d", ((smb_node_t *)arg0)->n_refcnt);
103     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg0)->vp)->v_path);
104     stack();
105 }
106 
107 sdt:smbsrv:smb_node_delete_on_close:smb_node_delete_on_close
108 /(int)arg0 == 0/
109 {
110     printf("\nSMB Node delete on close successful");
111     printf("\n\tNode: %p", arg1);
112     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg1)->vp)->v_path);
113     stack();
114 }
115 
116 sdt:smbsrv:smb_node_delete_on_close:smb_node_delete_on_close
117 /(int)arg0 == 0/
118 {
119     printf("\nSMB Node delete on close failed (%d)", (int)arg0);
120     printf("\n\tNode: %p", arg1);
121     printf("\n\tName: %s", (string)((vnode_t *)((smb_node_t *)arg1)->vp)->v_path);
122     stack();
123 }
124 
125 
126