gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
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
30
31#include "sim/stats.hh"
32
33namespace gem5
34{
35
37 : statistics::Group(parent, "EtherDevice"),
39 "Number of posts to CPU"),
40 ADD_STAT(txBytes, statistics::units::Byte::get(),
41 "Bytes Transmitted"),
42 ADD_STAT(rxBytes, statistics::units::Byte::get(), "Bytes Received"),
43 ADD_STAT(txPackets, statistics::units::Count::get(),
44 "Number of Packets Transmitted"),
45 ADD_STAT(rxPackets, statistics::units::Count::get(),
46 "Number of Packets Received"),
48 statistics::units::Bit, statistics::units::Second>::get(),
49 "Transmit Bandwidth",
52 statistics::units::Bit, statistics::units::Second>::get(),
53 "Receive Bandwidth",
55 ADD_STAT(txIpChecksums, statistics::units::Count::get(),
56 "Number of tx IP Checksums done by device"),
57 ADD_STAT(rxIpChecksums, statistics::units::Count::get(),
58 "Number of rx IP Checksums done by device"),
60 "Number of tx TCP Checksums done by device"),
62 "Number of rx TCP Checksums done by device"),
64 "Number of tx UDP Checksums done by device"),
66 "Number of rx UDP Checksums done by device"),
67 ADD_STAT(descDmaReads, statistics::units::Count::get(),
68 "Number of descriptors the device read w/ DMA"),
69 ADD_STAT(descDmaWrites, statistics::units::Count::get(),
70 "Number of descriptors the device wrote w/ DMA"),
72 "Number of descriptor bytes read w/ DMA"),
74 "Number of descriptor bytes write w/ DMA"),
76 statistics::units::Bit, statistics::units::Second>::get(),
77 "Total Bandwidth",
79 ADD_STAT(totPackets, statistics::units::Count::get(), "Total Packets",
81 ADD_STAT(totBytes, statistics::units::Byte::get(), "Total Bytes",
84 statistics::units::Count, statistics::units::Second>::get(),
85 "Total Packet Tranmission Rate",
88 statistics::units::Count, statistics::units::Second>::get(),
89 "Packet Tranmission Rate",
92 statistics::units::Count, statistics::units::Second>::get(),
93 "Packet Reception Rate",
95 ADD_STAT(postedSwi, statistics::units::Count::get(),
96 "Number of software interrupts posted to CPU"),
97 ADD_STAT(totalSwi, statistics::units::Count::get(),
98 "Total number of Swi written to ISR"),
100 statistics::units::Count, statistics::units::Count>::get(),
101 "Average number of Swi's coalesced into each post",
103 ADD_STAT(postedRxIdle, statistics::units::Count::get(),
104 "Number of rxIdle interrupts posted to CPU"),
105 ADD_STAT(totalRxIdle, statistics::units::Count::get(),
106 "Total number of RxIdle written to ISR"),
108 statistics::units::Count, statistics::units::Count>::get(),
109 "Average number of RxIdle's coalesced into each post",
111 ADD_STAT(postedRxOk, statistics::units::Count::get(),
112 "Number of RxOk interrupts posted to CPU"),
113 ADD_STAT(totalRxOk, statistics::units::Count::get(),
114 "Total number of RxOk written to ISR"),
116 statistics::units::Count, statistics::units::Count>::get(),
117 "Average number of RxOk's coalesced into each post",
119 ADD_STAT(postedRxDesc, statistics::units::Count::get(),
120 "Number of RxDesc interrupts posted to CPU"),
121 ADD_STAT(totalRxDesc, statistics::units::Count::get(),
122 "Total number of RxDesc written to ISR"),
124 statistics::units::Count, statistics::units::Count>::get(),
125 "Average number of RxDesc's coalesced into each post",
127 ADD_STAT(postedTxOk, statistics::units::Count::get(),
128 "Number of TxOk interrupts posted to CPU"),
129 ADD_STAT(totalTxOk, statistics::units::Count::get(),
130 "Total number of TxOk written to ISR"),
132 statistics::units::Count, statistics::units::Count>::get(),
133 "Average number of TxOk's coalesced into each post",
135 ADD_STAT(postedTxIdle, statistics::units::Count::get(),
136 "Number of TxIdle interrupts posted to CPU"),
137 ADD_STAT(totalTxIdle, statistics::units::Count::get(),
138 "Total number of TxIdle written to ISR"),
140 statistics::units::Count, statistics::units::Count>::get(),
141 "Average number of TxIdle's coalesced into each post",
143 ADD_STAT(postedTxDesc, statistics::units::Count::get(),
144 "Number of TxDesc interrupts posted to CPU"),
145 ADD_STAT(totalTxDesc, statistics::units::Count::get(),
146 "Total number of TxDesc written to ISR"),
148 statistics::units::Count, statistics::units::Count>::get(),
149 "Average number of TxDesc's coalesced into each post",
151 ADD_STAT(postedRxOrn, statistics::units::Count::get(),
152 "Number of RxOrn posted to CPU"),
153 ADD_STAT(totalRxOrn, statistics::units::Count::get(),
154 "Total number of RxOrn written to ISR"),
156 statistics::units::Count, statistics::units::Count>::get(),
157 "Average number of RxOrn's coalesced into each post",
160 statistics::units::Count, statistics::units::Count>::get(),
161 "Average number of interrupts coalesced into each post"),
162 ADD_STAT(droppedPackets, statistics::units::Count::get(),
163 "Number of packets dropped")
164{
165
167 .precision(0);
168
169 txBytes
170 .prereq(txBytes);
171
172 rxBytes
173 .prereq(rxBytes);
174
176 .prereq(txBytes);
177
179 .prereq(rxBytes);
180
182 .precision(0)
183 .prereq(txBytes);
184
186 .precision(0)
187 .prereq(rxBytes);
188
190 .precision(0)
191 .prereq(txBytes);
192
194 .precision(0)
195 .prereq(rxBytes);
196
198 .precision(0)
199 .prereq(txBytes);
200
202 .precision(0)
203 .prereq(rxBytes);
204
206 .precision(0);
207
209 .precision(0);
210
212 .precision(0);
213
215 .precision(0);
216
218 .precision(0)
219 .prereq(txBytes)
220 ;
221
223 .precision(0)
224 .prereq(rxBytes);
225
227 .precision(0)
228 .prereq(totBytes);
229
231 .precision(0)
232 .prereq(totBytes);
233
235 .precision(0)
236 .prereq(totBytes);
237
239 .precision(0)
240 .prereq(totBytes);
241
243 .precision(0)
244 .prereq(txBytes);
245
247 .precision(0)
248 .prereq(rxBytes);
249
251 .precision(0);
252
254 .precision(0);
255
257 .precision(0);
258
260 .precision(0);
261
263 .precision(0);
264
266 .precision(0);
267
269 .precision(0);
270
272 .precision(0);
273
275 .precision(0);
276
278 .precision(0);
279
281 .precision(0);
282
284 .precision(0);
285
287 .precision(0);
288
290 .precision(0);
291
293 .precision(0);
294
296 .precision(0);
297
299 .precision(0);
300
302 .precision(0);
303
305 .precision(0);
306
308 .precision(0);
309
311 .precision(0);
312
314 .precision(0);
315
317 .precision(0);
318
320 .precision(0);
321
323 .precision(0);
324
326 .precision(0);
327
331}
332
333} // namespace gem5
Statistics container.
Definition group.hh:93
Base Ethernet Device declaration.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition group.hh:75
Units for Stats.
Definition units.hh:113
Temp constant(T val)
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
statistics::Formula & simSeconds
Definition stats.cc:45
EtherDeviceStats(statistics::Group *parent)

Generated on Mon May 26 2025 09:19:10 for gem5 by doxygen 1.13.2