xref: /onnv-gate/usr/src/uts/common/smbsrv/smb_kstat.h (revision 12508:edb7861a1533)
16432Sas200622 /*
26432Sas200622  * CDDL HEADER START
36432Sas200622  *
46432Sas200622  * The contents of this file are subject to the terms of the
56432Sas200622  * Common Development and Distribution License (the "License").
66432Sas200622  * You may not use this file except in compliance with the License.
76432Sas200622  *
86432Sas200622  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96432Sas200622  * or http://www.opensolaris.org/os/licensing.
106432Sas200622  * See the License for the specific language governing permissions
116432Sas200622  * and limitations under the License.
126432Sas200622  *
136432Sas200622  * When distributing Covered Code, include this CDDL HEADER in each
146432Sas200622  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156432Sas200622  * If applicable, add the following below this CDDL HEADER, with the
166432Sas200622  * fields enclosed by brackets "[]" replaced with your own identifying
176432Sas200622  * information: Portions Copyright [yyyy] [name of copyright owner]
186432Sas200622  *
196432Sas200622  * CDDL HEADER END
206432Sas200622  */
216432Sas200622 /*
22*12508Samw@Sun.COM  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
236432Sas200622  */
246432Sas200622 
256432Sas200622 /*
266432Sas200622  * Kstat definitions for the SMB server module.
276432Sas200622  */
286432Sas200622 #ifndef _SMBSRV_SMB_KSTAT_H
296432Sas200622 #define	_SMBSRV_SMB_KSTAT_H
306432Sas200622 
31*12508Samw@Sun.COM #include	<smbsrv/smb.h>
32*12508Samw@Sun.COM 
336432Sas200622 #ifdef	__cplusplus
346432Sas200622 extern "C" {
356432Sas200622 #endif
366432Sas200622 
37*12508Samw@Sun.COM #define	SMBSRV_KSTAT_PROCESS		"smbd"
388934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_MODULE		"smbsrv"
398934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_CLASS		"net"
408934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_NAME		"smbsrv"
418934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_NAME_CMDS		"smbsrv_commands"
428934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_TXRCACHE		"smb_txreq"
438934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_REQUEST_CACHE	"smb_request_cache"
448934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_SESSION_CACHE	"smb_session_cache"
458934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_USER_CACHE		"smb_user_cache"
468934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_TREE_CACHE		"smb_tree_cache"
478934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_OFILE_CACHE	"smb_ofile_cache"
488934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_ODIR_CACHE		"smb_odir_cache"
498934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_NODE_CACHE		"smb_node_cache"
508934SJose.Borrego@Sun.COM #define	SMBSRV_KSTAT_MBC_CACHE		"smb_mbc_cache"
51*12508Samw@Sun.COM #define	SMBSRV_KSTAT_STATISTICS		"smbsrv_statistics"
52*12508Samw@Sun.COM #define	SMBSRV_KSTAT_UNSUPPORTED	"Unsupported"
53*12508Samw@Sun.COM #define	SMBSRV_KSTAT_WORKERS		"smb_workers"
54*12508Samw@Sun.COM 
55*12508Samw@Sun.COM #pragma pack(1)
56*12508Samw@Sun.COM 
57*12508Samw@Sun.COM typedef struct smb_kstat_utilization {
58*12508Samw@Sun.COM 	hrtime_t	ku_wtime;
59*12508Samw@Sun.COM 	hrtime_t	ku_wlentime;
60*12508Samw@Sun.COM 	hrtime_t	ku_rtime;
61*12508Samw@Sun.COM 	hrtime_t	ku_rlentime;
62*12508Samw@Sun.COM } smb_kstat_utilization_t;
63*12508Samw@Sun.COM 
64*12508Samw@Sun.COM typedef struct smb_kstat_req {
65*12508Samw@Sun.COM 	char		kr_name[KSTAT_STRLEN];
66*12508Samw@Sun.COM 	uint64_t	kr_sum;
67*12508Samw@Sun.COM 	uint64_t	kr_txb;
68*12508Samw@Sun.COM 	uint64_t	kr_rxb;
69*12508Samw@Sun.COM 	uint64_t	kr_nreq;
70*12508Samw@Sun.COM 	uint64_t	kr_a_mean;
71*12508Samw@Sun.COM 	uint64_t	kr_a_stddev;
72*12508Samw@Sun.COM 	uint64_t	kr_d_mean;
73*12508Samw@Sun.COM 	uint64_t	kr_d_stddev;
74*12508Samw@Sun.COM } smb_kstat_req_t;
75*12508Samw@Sun.COM 
76*12508Samw@Sun.COM typedef struct smbsrv_kstats {
77*12508Samw@Sun.COM 	hrtime_t		ks_start_time;
78*12508Samw@Sun.COM 	uint64_t		ks_txb;		/* Bytes transmitted */
79*12508Samw@Sun.COM 	uint64_t		ks_rxb;		/* Bytes received */
80*12508Samw@Sun.COM 	uint64_t		ks_nreq;	/* Requests treated */
81*12508Samw@Sun.COM 	smb_kstat_utilization_t	ks_utilization;
82*12508Samw@Sun.COM 	smb_kstat_req_t		ks_reqs[SMB_COM_NUM];
83*12508Samw@Sun.COM 	uint32_t		ks_nbt_sess;	/* NBT sessions */
84*12508Samw@Sun.COM 	uint32_t		ks_tcp_sess;	/* TCP sessions */
85*12508Samw@Sun.COM 	uint32_t		ks_users;	/* Users logged in */
86*12508Samw@Sun.COM 	uint32_t		ks_trees;	/* Trees connected */
87*12508Samw@Sun.COM 	uint32_t		ks_files;	/* Open files */
88*12508Samw@Sun.COM 	uint32_t		ks_pipes;	/* Open pipes */
89*12508Samw@Sun.COM 	uint32_t		ks_maxreqs;	/* Max number of reqs */
90*12508Samw@Sun.COM 	uint32_t		ks_padding;
91*12508Samw@Sun.COM } smbsrv_kstats_t;
92*12508Samw@Sun.COM 
93*12508Samw@Sun.COM #pragma pack()
946432Sas200622 
956432Sas200622 #ifdef	__cplusplus
966432Sas200622 }
976432Sas200622 #endif
986432Sas200622 
996432Sas200622 #endif /* _SMBSRV_SMB_KSTAT_H */
100