gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
etherdevice.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * 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  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Authors: Nathan Binkert
29  * Lisa Hsu
30  */
31 
32 #include "dev/net/etherdevice.hh"
33 
34 #include "sim/stats.hh"
35 
36 void
38 {
40 
41  txBytes
42  .name(name() + ".txBytes")
43  .desc("Bytes Transmitted")
44  .prereq(txBytes)
45  ;
46 
47  rxBytes
48  .name(name() + ".rxBytes")
49  .desc("Bytes Received")
50  .prereq(rxBytes)
51  ;
52 
53  txPackets
54  .name(name() + ".txPackets")
55  .desc("Number of Packets Transmitted")
56  .prereq(txBytes)
57  ;
58 
59  rxPackets
60  .name(name() + ".rxPackets")
61  .desc("Number of Packets Received")
62  .prereq(rxBytes)
63  ;
64 
66  .name(name() + ".txIpChecksums")
67  .desc("Number of tx IP Checksums done by device")
68  .precision(0)
69  .prereq(txBytes)
70  ;
71 
73  .name(name() + ".rxIpChecksums")
74  .desc("Number of rx IP Checksums done by device")
75  .precision(0)
76  .prereq(rxBytes)
77  ;
78 
80  .name(name() + ".txTcpChecksums")
81  .desc("Number of tx TCP Checksums done by device")
82  .precision(0)
83  .prereq(txBytes)
84  ;
85 
87  .name(name() + ".rxTcpChecksums")
88  .desc("Number of rx TCP Checksums done by device")
89  .precision(0)
90  .prereq(rxBytes)
91  ;
92 
94  .name(name() + ".txUdpChecksums")
95  .desc("Number of tx UDP Checksums done by device")
96  .precision(0)
97  .prereq(txBytes)
98  ;
99 
101  .name(name() + ".rxUdpChecksums")
102  .desc("Number of rx UDP Checksums done by device")
103  .precision(0)
104  .prereq(rxBytes)
105  ;
106 
108  .name(name() + ".descDMAReads")
109  .desc("Number of descriptors the device read w/ DMA")
110  .precision(0)
111  ;
112 
114  .name(name() + ".descDMAWrites")
115  .desc("Number of descriptors the device wrote w/ DMA")
116  .precision(0)
117  ;
118 
120  .name(name() + ".descDmaReadBytes")
121  .desc("number of descriptor bytes read w/ DMA")
122  .precision(0)
123  ;
124 
126  .name(name() + ".descDmaWriteBytes")
127  .desc("number of descriptor bytes write w/ DMA")
128  .precision(0)
129  ;
130 
132  .name(name() + ".txBandwidth")
133  .desc("Transmit Bandwidth (bits/s)")
134  .precision(0)
135  .prereq(txBytes)
136  ;
137 
139  .name(name() + ".rxBandwidth")
140  .desc("Receive Bandwidth (bits/s)")
141  .precision(0)
142  .prereq(rxBytes)
143  ;
144 
146  .name(name() + ".totBandwidth")
147  .desc("Total Bandwidth (bits/s)")
148  .precision(0)
149  .prereq(totBytes)
150  ;
151 
152  totPackets
153  .name(name() + ".totPackets")
154  .desc("Total Packets")
155  .precision(0)
156  .prereq(totBytes)
157  ;
158 
159  totBytes
160  .name(name() + ".totBytes")
161  .desc("Total Bytes")
162  .precision(0)
163  .prereq(totBytes)
164  ;
165 
167  .name(name() + ".totPPS")
168  .desc("Total Tranmission Rate (packets/s)")
169  .precision(0)
170  .prereq(totBytes)
171  ;
172 
174  .name(name() + ".txPPS")
175  .desc("Packet Tranmission Rate (packets/s)")
176  .precision(0)
177  .prereq(txBytes)
178  ;
179 
181  .name(name() + ".rxPPS")
182  .desc("Packet Reception Rate (packets/s)")
183  .precision(0)
184  .prereq(rxBytes)
185  ;
186 
187  postedSwi
188  .name(name() + ".postedSwi")
189  .desc("number of software interrupts posted to CPU")
190  .precision(0)
191  ;
192 
193  totalSwi
194  .name(name() + ".totalSwi")
195  .desc("total number of Swi written to ISR")
196  .precision(0)
197  ;
198 
200  .name(name() + ".coalescedSwi")
201  .desc("average number of Swi's coalesced into each post")
202  .precision(0)
203  ;
204 
206  .name(name() + ".postedRxIdle")
207  .desc("number of rxIdle interrupts posted to CPU")
208  .precision(0)
209  ;
210 
212  .name(name() + ".totalRxIdle")
213  .desc("total number of RxIdle written to ISR")
214  .precision(0)
215  ;
216 
218  .name(name() + ".coalescedRxIdle")
219  .desc("average number of RxIdle's coalesced into each post")
220  .precision(0)
221  ;
222 
223  postedRxOk
224  .name(name() + ".postedRxOk")
225  .desc("number of RxOk interrupts posted to CPU")
226  .precision(0)
227  ;
228 
229  totalRxOk
230  .name(name() + ".totalRxOk")
231  .desc("total number of RxOk written to ISR")
232  .precision(0)
233  ;
234 
236  .name(name() + ".coalescedRxOk")
237  .desc("average number of RxOk's coalesced into each post")
238  .precision(0)
239  ;
240 
242  .name(name() + ".postedRxDesc")
243  .desc("number of RxDesc interrupts posted to CPU")
244  .precision(0)
245  ;
246 
248  .name(name() + ".totalRxDesc")
249  .desc("total number of RxDesc written to ISR")
250  .precision(0)
251  ;
252 
254  .name(name() + ".coalescedRxDesc")
255  .desc("average number of RxDesc's coalesced into each post")
256  .precision(0)
257  ;
258 
259  postedTxOk
260  .name(name() + ".postedTxOk")
261  .desc("number of TxOk interrupts posted to CPU")
262  .precision(0)
263  ;
264 
265  totalTxOk
266  .name(name() + ".totalTxOk")
267  .desc("total number of TxOk written to ISR")
268  .precision(0)
269  ;
270 
272  .name(name() + ".coalescedTxOk")
273  .desc("average number of TxOk's coalesced into each post")
274  .precision(0)
275  ;
276 
278  .name(name() + ".postedTxIdle")
279  .desc("number of TxIdle interrupts posted to CPU")
280  .precision(0)
281  ;
282 
284  .name(name() + ".totalTxIdle")
285  .desc("total number of TxIdle written to ISR")
286  .precision(0)
287  ;
288 
290  .name(name() + ".coalescedTxIdle")
291  .desc("average number of TxIdle's coalesced into each post")
292  .precision(0)
293  ;
294 
296  .name(name() + ".postedTxDesc")
297  .desc("number of TxDesc interrupts posted to CPU")
298  .precision(0)
299  ;
300 
302  .name(name() + ".totalTxDesc")
303  .desc("total number of TxDesc written to ISR")
304  .precision(0)
305  ;
306 
308  .name(name() + ".coalescedTxDesc")
309  .desc("average number of TxDesc's coalesced into each post")
310  .precision(0)
311  ;
312 
314  .name(name() + ".postedRxOrn")
315  .desc("number of RxOrn posted to CPU")
316  .precision(0)
317  ;
318 
319  totalRxOrn
320  .name(name() + ".totalRxOrn")
321  .desc("total number of RxOrn written to ISR")
322  .precision(0)
323  ;
324 
326  .name(name() + ".coalescedRxOrn")
327  .desc("average number of RxOrn's coalesced into each post")
328  .precision(0)
329  ;
330 
332  .name(name() + ".coalescedTotal")
333  .desc("average number of interrupts coalesced into each post")
334  .precision(0)
335  ;
336 
338  .name(name() + ".postedInterrupts")
339  .desc("number of posts to CPU")
340  .precision(0)
341  ;
342 
344  .name(name() + ".droppedPackets")
345  .desc("number of packets dropped")
346  .precision(0)
347  ;
348 
357 
361 
367 
369  rxPacketRate = rxPackets / simSeconds;
371 }
Stats::Formula totBandwidth
Definition: etherdevice.hh:87
Stats::Scalar postedSwi
Definition: etherdevice.hh:95
Stats::Scalar totalRxIdle
Definition: etherdevice.hh:100
Stats::Scalar descDmaReads
Definition: etherdevice.hh:83
Stats::Scalar descDmaWrites
Definition: etherdevice.hh:84
Stats::Scalar totalRxOk
Definition: etherdevice.hh:103
Stats::Scalar totalTxOk
Definition: etherdevice.hh:109
Stats::Scalar rxIpChecksums
Definition: etherdevice.hh:78
Stats::Scalar rxUdpChecksums
Definition: etherdevice.hh:82
Stats::Scalar postedRxIdle
Definition: etherdevice.hh:98
Stats::Scalar totalRxDesc
Definition: etherdevice.hh:106
Stats::Scalar rxTcpChecksums
Definition: etherdevice.hh:80
Stats::Scalar txBytes
Definition: etherdevice.hh:73
Stats::Formula coalescedRxOrn
Definition: etherdevice.hh:117
Stats::Formula totPackets
Definition: etherdevice.hh:88
Stats::Formula simSeconds
Definition: stat_control.cc:64
Stats::Scalar postedTxDesc
Definition: etherdevice.hh:113
Stats::Formula coalescedTxOk
Definition: etherdevice.hh:108
Stats::Scalar postedTxOk
Definition: etherdevice.hh:107
Stats::Scalar rxPackets
Definition: etherdevice.hh:76
Stats::Formula coalescedTxDesc
Definition: etherdevice.hh:114
Stats::Formula txBandwidth
Definition: etherdevice.hh:91
void regStats()
Register statistics for this object.
Definition: etherdevice.cc:37
Stats::Scalar totalTxDesc
Definition: etherdevice.hh:115
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
Definition: statistics.hh:325
Stats::Formula coalescedTxIdle
Definition: etherdevice.hh:111
Temp constant(T val)
Definition: statistics.hh:3211
Stats::Scalar totalRxOrn
Definition: etherdevice.hh:118
Stats::Scalar descDmaWrBytes
Definition: etherdevice.hh:86
Stats::Scalar txIpChecksums
Definition: etherdevice.hh:77
Stats::Scalar postedTxIdle
Definition: etherdevice.hh:110
Stats::Scalar droppedPackets
Definition: etherdevice.hh:121
Stats::Scalar descDmaRdBytes
Definition: etherdevice.hh:85
Derived & precision(int _precision)
Set the precision and marks this stat to print at the end of simulation.
Definition: statistics.hh:299
Stats::Formula coalescedSwi
Definition: etherdevice.hh:96
Stats::Scalar postedRxOk
Definition: etherdevice.hh:101
Base Ethernet Device declaration.
Stats::Scalar rxBytes
Definition: etherdevice.hh:74
Stats::Scalar totalTxIdle
Definition: etherdevice.hh:112
Stats::Formula coalescedRxIdle
Definition: etherdevice.hh:99
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Definition: statistics.hh:254
Stats::Scalar txUdpChecksums
Definition: etherdevice.hh:81
Stats::Scalar postedRxOrn
Definition: etherdevice.hh:116
Stats::Formula txPacketRate
Definition: etherdevice.hh:93
Stats::Formula coalescedTotal
Definition: etherdevice.hh:119
virtual const std::string name() const
Definition: sim_object.hh:117
Stats::Formula totBytes
Definition: etherdevice.hh:89
Stats::Scalar postedRxDesc
Definition: etherdevice.hh:104
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Definition: statistics.hh:287
Stats::Scalar totalSwi
Definition: etherdevice.hh:97
Stats::Formula rxPacketRate
Definition: etherdevice.hh:94
Stats::Formula rxBandwidth
Definition: etherdevice.hh:92
Stats::Scalar postedInterrupts
Definition: etherdevice.hh:120
Stats::Formula coalescedRxDesc
Definition: etherdevice.hh:105
void regStats() override
Register statistics for this object.
Stats::Formula coalescedRxOk
Definition: etherdevice.hh:102
Stats::Scalar txTcpChecksums
Definition: etherdevice.hh:79
Stats::Formula totPacketRate
Definition: etherdevice.hh:90
Stats::Scalar txPackets
Definition: etherdevice.hh:75

Generated on Fri Jun 9 2017 13:03:46 for gem5 by doxygen 1.8.6