rx: add post RPC procedure capability
[openafs.git] / src / rx / rx_stats.h
1 /*
2  * Copyright (c) 2010 Your File System Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 /* rx_stats.h
26  *
27  * These are internal structures used by the rx statistics code. Nothing
28  * in this file should be visible outside the RX module.
29  */
30
31 /* We memcpy between rx_statisticsAtomic and rx_statistics, so the two
32  * structures must have the same elements, and sizeof(rx_atomic_t) must
33  * equal sizeof(int)
34  */
35
36 struct rx_statisticsAtomic {    /* Atomic version of rx_statistics */
37     rx_atomic_t packetRequests;
38     rx_atomic_t receivePktAllocFailures;
39     rx_atomic_t sendPktAllocFailures;
40     rx_atomic_t specialPktAllocFailures;
41     rx_atomic_t socketGreedy;
42     rx_atomic_t bogusPacketOnRead;
43     int bogusHost;
44     rx_atomic_t noPacketOnRead;
45     rx_atomic_t noPacketBuffersOnRead;
46     rx_atomic_t selects;
47     rx_atomic_t sendSelects;
48     rx_atomic_t packetsRead[RX_N_PACKET_TYPES];
49     rx_atomic_t dataPacketsRead;
50     rx_atomic_t ackPacketsRead;
51     rx_atomic_t dupPacketsRead;
52     rx_atomic_t spuriousPacketsRead;
53     rx_atomic_t packetsSent[RX_N_PACKET_TYPES];
54     rx_atomic_t ackPacketsSent;
55     rx_atomic_t pingPacketsSent;
56     rx_atomic_t abortPacketsSent;
57     rx_atomic_t busyPacketsSent;
58     rx_atomic_t dataPacketsSent;
59     rx_atomic_t dataPacketsReSent;
60     rx_atomic_t dataPacketsPushed;
61     rx_atomic_t ignoreAckedPacket;
62     struct clock totalRtt;
63     struct clock minRtt;
64     struct clock maxRtt;
65     rx_atomic_t nRttSamples;
66     rx_atomic_t nServerConns;
67     rx_atomic_t nClientConns;
68     rx_atomic_t nPeerStructs;
69     rx_atomic_t nCallStructs;
70     rx_atomic_t nFreeCallStructs;
71     rx_atomic_t netSendFailures;
72     rx_atomic_t fatalErrors;
73     rx_atomic_t ignorePacketDally;
74     rx_atomic_t receiveCbufPktAllocFailures;
75     rx_atomic_t sendCbufPktAllocFailures;
76     rx_atomic_t nBusies;
77     rx_atomic_t spares[4];
78 };
79
80 #if defined(RX_ENABLE_LOCKS)
81 extern afs_kmutex_t rx_stats_mutex;
82 #endif
83
84 extern struct rx_statisticsAtomic rx_stats;
85
86 extern void rxi_ResetStatistics(void);