2 * Copyright (c) 2010 Your File System Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
27 * These are internal structures used by the rx statistics code. Nothing
28 * in this file should be visible outside the RX module.
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
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
;
44 rx_atomic_t noPacketOnRead
;
45 rx_atomic_t noPacketBuffersOnRead
;
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
;
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
;
77 rx_atomic_t spares
[4];
80 #if defined(RX_ENABLE_LOCKS)
81 extern afs_kmutex_t rx_stats_mutex
;
84 extern struct rx_statisticsAtomic rx_stats
;
86 extern void rxi_ResetStatistics(void);