1 /* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)nfsrtt.h 8.1 (Berkeley) 06/10/93 11 */ 12 13 /* 14 * Definitions for performance monitor. 15 * The client and server logging are turned on by setting the global 16 * constant "nfsrtton" to 1. 17 */ 18 #define NFSRTTLOGSIZ 128 19 20 /* 21 * Circular log of client side rpc activity. Each log entry is for one 22 * rpc filled in upon completion. (ie. in order of completion) 23 * The "pos" is the table index for the "next" entry, therefore the 24 * list goes from nfsrtt.rttl[pos] --> nfsrtt.rttl[pos - 1] in 25 * chronological order of completion. 26 */ 27 struct nfsrtt { 28 int pos; /* Position in array for next entry */ 29 struct rttl { 30 int proc; /* NFS procedure number */ 31 int rtt; /* Measured round trip time */ 32 int rto; /* Round Trip Timeout */ 33 int sent; /* # rpcs in progress */ 34 int cwnd; /* Send window */ 35 int srtt; /* Ave Round Trip Time */ 36 int sdrtt; /* Ave mean deviation of RTT */ 37 fsid_t fsid; /* Fsid for mount point */ 38 struct timeval tstamp; /* Timestamp of log entry */ 39 } rttl[NFSRTTLOGSIZ]; 40 }; 41 42 /* 43 * And definitions for server side performance monitor. 44 * The log organization is the same as above except it is filled in at the 45 * time the server sends the rpc reply. 46 */ 47 48 /* 49 * Bits for the flags field. 50 */ 51 #define DRT_NQNFS 0x01 /* Rpc used Nqnfs protocol */ 52 #define DRT_TCP 0x02 /* Client used TCP transport */ 53 #define DRT_CACHEREPLY 0x04 /* Reply was from recent request cache */ 54 #define DRT_CACHEDROP 0x08 /* Rpc request dropped, due to recent reply */ 55 56 /* 57 * Server log structure 58 * NB: ipadr == INADDR_ANY indicates a client using a non IP protocol. 59 * (ISO perhaps?) 60 */ 61 struct nfsdrt { 62 int pos; /* Position of next log entry */ 63 struct drt { 64 int flag; /* Bits as defined above */ 65 int proc; /* NFS procedure number */ 66 u_long ipadr; /* IP address of client */ 67 int resptime; /* Response time (usec) */ 68 struct timeval tstamp; /* Timestamp of log entry */ 69 } drt[NFSRTTLOGSIZ]; 70 }; 71