xref: /titanic_44/usr/src/uts/common/smbsrv/smb_kstat.h (revision 6a634c9dca3093f3922e4b7ab826d7bdf17bf78e)
16537f381Sas200622 /*
26537f381Sas200622  * CDDL HEADER START
36537f381Sas200622  *
46537f381Sas200622  * The contents of this file are subject to the terms of the
56537f381Sas200622  * Common Development and Distribution License (the "License").
66537f381Sas200622  * You may not use this file except in compliance with the License.
76537f381Sas200622  *
86537f381Sas200622  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96537f381Sas200622  * or http://www.opensolaris.org/os/licensing.
106537f381Sas200622  * See the License for the specific language governing permissions
116537f381Sas200622  * and limitations under the License.
126537f381Sas200622  *
136537f381Sas200622  * When distributing Covered Code, include this CDDL HEADER in each
146537f381Sas200622  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156537f381Sas200622  * If applicable, add the following below this CDDL HEADER, with the
166537f381Sas200622  * fields enclosed by brackets "[]" replaced with your own identifying
176537f381Sas200622  * information: Portions Copyright [yyyy] [name of copyright owner]
186537f381Sas200622  *
196537f381Sas200622  * CDDL HEADER END
206537f381Sas200622  */
216537f381Sas200622 /*
22148c5f43SAlan Wright  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
236537f381Sas200622  */
246537f381Sas200622 
256537f381Sas200622 /*
266537f381Sas200622  * Kstat definitions for the SMB server module.
276537f381Sas200622  */
286537f381Sas200622 #ifndef _SMBSRV_SMB_KSTAT_H
296537f381Sas200622 #define	_SMBSRV_SMB_KSTAT_H
306537f381Sas200622 
31148c5f43SAlan Wright #include	<smbsrv/smb.h>
32148c5f43SAlan Wright 
336537f381Sas200622 #ifdef	__cplusplus
346537f381Sas200622 extern "C" {
356537f381Sas200622 #endif
366537f381Sas200622 
37148c5f43SAlan Wright #define	SMBSRV_KSTAT_PROCESS		"smbd"
386537f381Sas200622 #define	SMBSRV_KSTAT_MODULE		"smbsrv"
396537f381Sas200622 #define	SMBSRV_KSTAT_CLASS		"net"
406537f381Sas200622 #define	SMBSRV_KSTAT_NAME		"smbsrv"
416537f381Sas200622 #define	SMBSRV_KSTAT_NAME_CMDS		"smbsrv_commands"
4221b7895dSjb150015 #define	SMBSRV_KSTAT_TXRCACHE		"smb_txreq"
432c2961f8Sjose borrego #define	SMBSRV_KSTAT_REQUEST_CACHE	"smb_request_cache"
442c2961f8Sjose borrego #define	SMBSRV_KSTAT_SESSION_CACHE	"smb_session_cache"
452c2961f8Sjose borrego #define	SMBSRV_KSTAT_USER_CACHE		"smb_user_cache"
462c2961f8Sjose borrego #define	SMBSRV_KSTAT_TREE_CACHE		"smb_tree_cache"
472c2961f8Sjose borrego #define	SMBSRV_KSTAT_OFILE_CACHE	"smb_ofile_cache"
482c2961f8Sjose borrego #define	SMBSRV_KSTAT_ODIR_CACHE		"smb_odir_cache"
492c2961f8Sjose borrego #define	SMBSRV_KSTAT_NODE_CACHE		"smb_node_cache"
502c2961f8Sjose borrego #define	SMBSRV_KSTAT_MBC_CACHE		"smb_mbc_cache"
51148c5f43SAlan Wright #define	SMBSRV_KSTAT_STATISTICS		"smbsrv_statistics"
52148c5f43SAlan Wright #define	SMBSRV_KSTAT_UNSUPPORTED	"Unsupported"
53148c5f43SAlan Wright #define	SMBSRV_KSTAT_WORKERS		"smb_workers"
54148c5f43SAlan Wright 
55148c5f43SAlan Wright #pragma pack(1)
56148c5f43SAlan Wright 
57148c5f43SAlan Wright typedef struct smb_kstat_utilization {
58148c5f43SAlan Wright 	hrtime_t	ku_wtime;
59148c5f43SAlan Wright 	hrtime_t	ku_wlentime;
60148c5f43SAlan Wright 	hrtime_t	ku_rtime;
61148c5f43SAlan Wright 	hrtime_t	ku_rlentime;
62148c5f43SAlan Wright } smb_kstat_utilization_t;
63148c5f43SAlan Wright 
64148c5f43SAlan Wright typedef struct smb_kstat_req {
65148c5f43SAlan Wright 	char		kr_name[KSTAT_STRLEN];
66*cb174861Sjoyce mcintosh 	char		kr_pad[(~(KSTAT_STRLEN & 0x07) + 1) & 0x07];
67148c5f43SAlan Wright 	uint64_t	kr_sum;
68148c5f43SAlan Wright 	uint64_t	kr_txb;
69148c5f43SAlan Wright 	uint64_t	kr_rxb;
70148c5f43SAlan Wright 	uint64_t	kr_nreq;
71148c5f43SAlan Wright 	uint64_t	kr_a_mean;
72148c5f43SAlan Wright 	uint64_t	kr_a_stddev;
73148c5f43SAlan Wright 	uint64_t	kr_d_mean;
74148c5f43SAlan Wright 	uint64_t	kr_d_stddev;
75148c5f43SAlan Wright } smb_kstat_req_t;
76148c5f43SAlan Wright 
77148c5f43SAlan Wright typedef struct smbsrv_kstats {
78148c5f43SAlan Wright 	hrtime_t		ks_start_time;
79148c5f43SAlan Wright 	uint64_t		ks_txb;		/* Bytes transmitted */
80148c5f43SAlan Wright 	uint64_t		ks_rxb;		/* Bytes received */
81148c5f43SAlan Wright 	uint64_t		ks_nreq;	/* Requests treated */
82148c5f43SAlan Wright 	smb_kstat_utilization_t	ks_utilization;
83148c5f43SAlan Wright 	smb_kstat_req_t		ks_reqs[SMB_COM_NUM];
84148c5f43SAlan Wright 	uint32_t		ks_nbt_sess;	/* NBT sessions */
85148c5f43SAlan Wright 	uint32_t		ks_tcp_sess;	/* TCP sessions */
86148c5f43SAlan Wright 	uint32_t		ks_users;	/* Users logged in */
87148c5f43SAlan Wright 	uint32_t		ks_trees;	/* Trees connected */
88148c5f43SAlan Wright 	uint32_t		ks_files;	/* Open files */
89148c5f43SAlan Wright 	uint32_t		ks_pipes;	/* Open pipes */
90148c5f43SAlan Wright 	uint32_t		ks_maxreqs;	/* Max number of reqs */
91148c5f43SAlan Wright 	uint32_t		ks_padding;
92148c5f43SAlan Wright } smbsrv_kstats_t;
93148c5f43SAlan Wright 
94148c5f43SAlan Wright #pragma pack()
956537f381Sas200622 
966537f381Sas200622 #ifdef	__cplusplus
976537f381Sas200622 }
986537f381Sas200622 #endif
996537f381Sas200622 
1006537f381Sas200622 #endif /* _SMBSRV_SMB_KSTAT_H */
101