xref: /titanic_50/usr/src/uts/common/smbsrv/smb_kstat.h (revision 7ff178cd8db129d385d3177eb20744d3b6efc59b)
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  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 /*
26  * Kstat definitions for the SMB server module.
27  */
28 #ifndef _SMBSRV_SMB_KSTAT_H
29 #define	_SMBSRV_SMB_KSTAT_H
30 
31 #include	<smbsrv/smb.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 #define	SMBSRV_KSTAT_PROCESS		"smbd"
38 #define	SMBSRV_KSTAT_MODULE		"smbsrv"
39 #define	SMBSRV_KSTAT_CLASS		"net"
40 #define	SMBSRV_KSTAT_NAME		"smbsrv"
41 #define	SMBSRV_KSTAT_NAME_CMDS		"smbsrv_commands"
42 #define	SMBSRV_KSTAT_TXRCACHE		"smb_txreq"
43 #define	SMBSRV_KSTAT_REQUEST_CACHE	"smb_request_cache"
44 #define	SMBSRV_KSTAT_SESSION_CACHE	"smb_session_cache"
45 #define	SMBSRV_KSTAT_USER_CACHE		"smb_user_cache"
46 #define	SMBSRV_KSTAT_TREE_CACHE		"smb_tree_cache"
47 #define	SMBSRV_KSTAT_OFILE_CACHE	"smb_ofile_cache"
48 #define	SMBSRV_KSTAT_ODIR_CACHE		"smb_odir_cache"
49 #define	SMBSRV_KSTAT_NODE_CACHE		"smb_node_cache"
50 #define	SMBSRV_KSTAT_MBC_CACHE		"smb_mbc_cache"
51 #define	SMBSRV_KSTAT_STATISTICS		"smbsrv_statistics"
52 #define	SMBSRV_KSTAT_UNSUPPORTED	"Unsupported"
53 #define	SMBSRV_KSTAT_WORKERS		"smb_workers"
54 
55 #pragma pack(1)
56 
57 typedef struct smb_kstat_utilization {
58 	hrtime_t	ku_wtime;
59 	hrtime_t	ku_wlentime;
60 	hrtime_t	ku_rtime;
61 	hrtime_t	ku_rlentime;
62 } smb_kstat_utilization_t;
63 
64 typedef struct smb_kstat_req {
65 	char		kr_name[KSTAT_STRLEN];
66 	uint64_t	kr_sum;
67 	uint64_t	kr_txb;
68 	uint64_t	kr_rxb;
69 	uint64_t	kr_nreq;
70 	uint64_t	kr_a_mean;
71 	uint64_t	kr_a_stddev;
72 	uint64_t	kr_d_mean;
73 	uint64_t	kr_d_stddev;
74 } smb_kstat_req_t;
75 
76 typedef struct smbsrv_kstats {
77 	hrtime_t		ks_start_time;
78 	uint64_t		ks_txb;		/* Bytes transmitted */
79 	uint64_t		ks_rxb;		/* Bytes received */
80 	uint64_t		ks_nreq;	/* Requests treated */
81 	smb_kstat_utilization_t	ks_utilization;
82 	smb_kstat_req_t		ks_reqs[SMB_COM_NUM];
83 	uint32_t		ks_nbt_sess;	/* NBT sessions */
84 	uint32_t		ks_tcp_sess;	/* TCP sessions */
85 	uint32_t		ks_users;	/* Users logged in */
86 	uint32_t		ks_trees;	/* Trees connected */
87 	uint32_t		ks_files;	/* Open files */
88 	uint32_t		ks_pipes;	/* Open pipes */
89 	uint32_t		ks_maxreqs;	/* Max number of reqs */
90 	uint32_t		ks_padding;
91 } smbsrv_kstats_t;
92 
93 #pragma pack()
94 
95 #ifdef	__cplusplus
96 }
97 #endif
98 
99 #endif /* _SMBSRV_SMB_KSTAT_H */
100