1 #ifndef __STAT_H_
2 #define __STAT_H_
3 
4 #include "io_module.h"
5 
6 struct run_stat
7 {
8 	uint64_t rounds;
9 	uint64_t rounds_rx;
10 	uint64_t rounds_rx_try;
11 	uint64_t rounds_tx;
12 	uint64_t rounds_tx_try;
13 	uint64_t rounds_select;
14 	uint64_t rounds_select_rx;
15 	uint64_t rounds_select_tx;
16 	uint64_t rounds_select_intr;
17 
18 	uint64_t rounds_accept;
19 	uint64_t rounds_read;
20 	uint64_t rounds_write;
21 	uint64_t rounds_epoll;
22 	uint64_t rounds_wndadv;
23 
24 	uint64_t rounds_rtocheck;
25 	uint64_t rounds_twcheck;
26 	uint64_t rounds_tocheck;
27 };
28 
29 struct stat_counter
30 {
31 	uint64_t cnt;
32 	uint64_t sum;
33 	uint64_t max;
34 	uint64_t min;
35 };
36 
37 struct time_stat
38 {
39 	struct stat_counter round;
40 	struct stat_counter processing;
41 	struct stat_counter tcheck;
42 	struct stat_counter epoll;
43 	struct stat_counter handle;
44 	struct stat_counter xmit;
45 	struct stat_counter select;
46 };
47 
48 struct net_stat
49 {
50 	uint64_t tx_packets[MAX_DEVICES];
51 	uint64_t tx_bytes[MAX_DEVICES];
52 	uint64_t tx_drops[MAX_DEVICES];
53 	uint64_t rx_packets[MAX_DEVICES];
54 	uint64_t rx_bytes[MAX_DEVICES];
55 	uint64_t rx_errors[MAX_DEVICES];
56 };
57 
58 struct bcast_stat
59 {
60 	uint64_t cycles;
61 	uint64_t write;
62 	uint64_t read;
63 	uint64_t epoll;
64 	uint64_t wnd_adv;
65 	uint64_t ack;
66 };
67 
68 struct timeout_stat
69 {
70 	uint64_t cycles;
71 	uint64_t rto_try;
72 	uint64_t rto;
73 	uint64_t timewait_try;
74 	uint64_t timewait;
75 };
76 
77 #ifdef NETSTAT
78 #define STAT_COUNT(stat) stat++
79 #else
80 #define STAT_COUNT(stat)
81 #endif
82 
83 #endif /* __STAT_H_ */
84