smb_kstat.h revision cb174861876aea6950a7ab4ce944aff84b1914cd
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas/*
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * CDDL HEADER START
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas *
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * The contents of this file are subject to the terms of the
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * Common Development and Distribution License (the "License").
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * You may not use this file except in compliance with the License.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas *
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * or http://www.opensolaris.org/os/licensing.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * See the License for the specific language governing permissions
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * and limitations under the License.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas *
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * When distributing Covered Code, include this CDDL HEADER in each
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * If applicable, add the following below this CDDL HEADER, with the
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * fields enclosed by brackets "[]" replaced with your own identifying
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * information: Portions Copyright [yyyy] [name of copyright owner]
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas *
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * CDDL HEADER END
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas/*
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas/*
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas * Kstat definitions for the SMB server module.
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#ifndef _SMBSRV_SMB_KSTAT_H
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#define _SMBSRV_SMB_KSTAT_H
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#include <smbsrv/smb.h>
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#ifdef __cplusplus
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2easextern "C" {
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#endif
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define SMBSRV_KSTAT_PROCESS "smbd"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_MODULE "smbsrv"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_CLASS "net"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_NAME "smbsrv"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_NAME_CMDS "smbsrv_commands"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_TXRCACHE "smb_txreq"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_REQUEST_CACHE "smb_request_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_SESSION_CACHE "smb_session_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_USER_CACHE "smb_user_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_TREE_CACHE "smb_tree_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_OFILE_CACHE "smb_ofile_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_ODIR_CACHE "smb_odir_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_NODE_CACHE "smb_node_cache"
2c2961f8403049d948b9f3e6c35d6488b6b7e1aajose borrego#define SMBSRV_KSTAT_MBC_CACHE "smb_mbc_cache"
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define SMBSRV_KSTAT_STATISTICS "smbsrv_statistics"
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define SMBSRV_KSTAT_UNSUPPORTED "Unsupported"
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define SMBSRV_KSTAT_WORKERS "smb_workers"
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#pragma pack(1)
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wrighttypedef struct smb_kstat_utilization {
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright hrtime_t ku_wtime;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright hrtime_t ku_wlentime;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright hrtime_t ku_rtime;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright hrtime_t ku_rlentime;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright} smb_kstat_utilization_t;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wrighttypedef struct smb_kstat_req {
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright char kr_name[KSTAT_STRLEN];
cb174861876aea6950a7ab4ce944aff84b1914cdjoyce mcintosh char kr_pad[(~(KSTAT_STRLEN & 0x07) + 1) & 0x07];
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_sum;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_txb;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_rxb;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_nreq;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_a_mean;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_a_stddev;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_d_mean;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t kr_d_stddev;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright} smb_kstat_req_t;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wrighttypedef struct smbsrv_kstats {
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright hrtime_t ks_start_time;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t ks_txb; /* Bytes transmitted */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t ks_rxb; /* Bytes received */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint64_t ks_nreq; /* Requests treated */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright smb_kstat_utilization_t ks_utilization;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright smb_kstat_req_t ks_reqs[SMB_COM_NUM];
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_nbt_sess; /* NBT sessions */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_tcp_sess; /* TCP sessions */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_users; /* Users logged in */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_trees; /* Trees connected */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_files; /* Open files */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_pipes; /* Open pipes */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_maxreqs; /* Max number of reqs */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright uint32_t ks_padding;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright} smbsrv_kstats_t;
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#pragma pack()
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#ifdef __cplusplus
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas}
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#endif
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas#endif /* _SMBSRV_SMB_KSTAT_H */