VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/counters.h@ 76747

Last change on this file since 76747 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/** $Id: counters.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * Counters macro invocation template.
4 *
5 * This is included with different PROFILE_COUNTER and COUNTING_COUNTER
6 * implementations to instantiate data members, create function prototypes and
7 * implement these prototypes.
8 */
9
10/*
11 * Copyright (C) 2007-2019 Oracle Corporation
12 *
13 * This file is part of VirtualBox Open Source Edition (OSE), as
14 * available from http://www.virtualbox.org. This file is free software;
15 * you can redistribute it and/or modify it under the terms of the GNU
16 * General Public License (GPL) as published by the Free Software
17 * Foundation, in version 2 as it comes in the "COPYING" file of the
18 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
19 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20 */
21
22/*
23 * COUNTERS_INIT is used before using counters.h to declare helping macro
24 * definitions for (de-)registering counters
25 */
26#ifndef COUNTERS_H
27# define COUNTERS_H
28# if defined(VBOX_WITH_STATISTICS)
29# define REGISTER_COUNTER(name, storage, type, units, dsc) \
30 do { \
31 PDMDrvHlpSTAMRegisterF(pDrvIns, \
32 &(storage)->Stat ## name, \
33 type, \
34 STAMVISIBILITY_ALWAYS, \
35 units, \
36 dsc, \
37 "/Drivers/NAT%u/" #name, \
38 pDrvIns->iInstance); \
39 } while (0)
40# define DEREGISTER_COUNTER(name, storage) PDMDrvHlpSTAMDeregister(pDrvIns, &(storage)->Stat ## name)
41# else
42# define REGISTER_COUNTER(name, storage, type, units, dsc) do {} while (0)
43# define DEREGISTER_COUNTER(name, storage) do {} while (0)
44# endif
45#else
46# undef COUNTERS_INIT
47#endif
48
49#ifndef COUNTERS_INIT
50# if !defined(PROFILE_COUNTER) && !defined(DRV_PROFILE_COUNTER)
51# error (DRV_)PROFILE_COUNTER is not defied
52# endif
53# if !defined(COUNTING_COUNTER) && !defined(DRV_COUNTING_COUNTER)
54# error (DRV_)COUNTING_COUNTER is not defined
55# endif
56
57/*
58 * DRV_ prefixed are counters used in DrvNAT the rest are used in Slirp
59 */
60
61# if defined(PROFILE_COUNTER) || defined(COUNTING_COUNTER)
62PROFILE_COUNTER(Fill, "Profiling slirp fills");
63PROFILE_COUNTER(Poll, "Profiling slirp polls");
64PROFILE_COUNTER(FastTimer, "Profiling slirp fast timer");
65PROFILE_COUNTER(SlowTimer, "Profiling slirp slow timer");
66PROFILE_COUNTER(IOwrite, "Profiling IO sowrite");
67PROFILE_COUNTER(IOread, "Profiling IO soread");
68
69COUNTING_COUNTER(TCP, "TCP sockets");
70COUNTING_COUNTER(TCPHot, "TCP sockets active");
71COUNTING_COUNTER(UDP, "UDP sockets");
72COUNTING_COUNTER(UDPHot, "UDP sockets active");
73
74COUNTING_COUNTER(IORead_in_1, "SB IORead_in_1");
75COUNTING_COUNTER(IORead_in_1_bytes, "SB IORead_in_1_bytes");
76COUNTING_COUNTER(IORead_in_2, "SB IORead_in_2");
77COUNTING_COUNTER(IORead_in_2_1st_bytes, "SB IORead_in_2_1st_bytes");
78COUNTING_COUNTER(IORead_in_2_2nd_bytes, "SB IORead_in_2_2nd_bytes");
79COUNTING_COUNTER(IOWrite_in_1, "SB IOWrite_in_1");
80COUNTING_COUNTER(IOWrite_in_1_bytes, "SB IOWrite_in_1_bytes");
81COUNTING_COUNTER(IOWrite_in_2, "SB IOWrite_in_2");
82COUNTING_COUNTER(IOWrite_in_2_1st_bytes, "SB IOWrite_in_2_1st_bytes");
83COUNTING_COUNTER(IOWrite_in_2_2nd_bytes, "SB IOWrite_in_2_2nd_bytes");
84COUNTING_COUNTER(IOWrite_no_w, "SB IOWrite_no_w");
85COUNTING_COUNTER(IOWrite_rest, "SB IOWrite_rest");
86COUNTING_COUNTER(IOWrite_rest_bytes, "SB IOWrite_rest_bytes");
87
88PROFILE_COUNTER(IOSBAppend_pf, "Profiling sbuf::append common");
89PROFILE_COUNTER(IOSBAppend_pf_wa, "Profiling sbuf::append all writen in network");
90PROFILE_COUNTER(IOSBAppend_pf_wf, "Profiling sbuf::append writen fault");
91PROFILE_COUNTER(IOSBAppend_pf_wp, "Profiling sbuf::append writen partly");
92COUNTING_COUNTER(IOSBAppend, "SB: Append total");
93COUNTING_COUNTER(IOSBAppend_wa, "SB: Append all is written to network ");
94COUNTING_COUNTER(IOSBAppend_wf, "SB: Append nothing is written");
95COUNTING_COUNTER(IOSBAppend_wp, "SB: Append is written partly");
96COUNTING_COUNTER(IOSBAppend_zm, "SB: Append mbuf is zerro or less");
97
98COUNTING_COUNTER(IOSBAppendSB, "SB: AppendSB total");
99COUNTING_COUNTER(IOSBAppendSB_w_l_r, "SB: AppendSB (sb_wptr < sb_rptr)");
100COUNTING_COUNTER(IOSBAppendSB_w_ge_r, "SB: AppendSB (sb_wptr >= sb_rptr)");
101COUNTING_COUNTER(IOSBAppendSB_w_alter, "SB: AppendSB (altering of sb_wptr)");
102COUNTING_COUNTER(MBufAllocation,"MBUF::shows number of mbufs in used list");
103
104COUNTING_COUNTER(TCP_retransmit, "TCP::retransmit");
105
106PROFILE_COUNTER(TCP_reassamble, "TCP::reasamble");
107PROFILE_COUNTER(TCP_input, "TCP::input");
108PROFILE_COUNTER(IP_input, "IP::input");
109PROFILE_COUNTER(IP_output, "IP::output");
110PROFILE_COUNTER(IF_encap, "IF::encap");
111PROFILE_COUNTER(ALIAS_input, "ALIAS::input");
112PROFILE_COUNTER(ALIAS_output, "ALIAS::output");
113
114# else
115/*DrvNAT.cpp*/
116DRV_COUNTING_COUNTER(NATRecvWakeups, "counting wakeups of NAT RX thread");
117DRV_PROFILE_COUNTER(NATRecv,"Time spent in NATRecv worker");
118DRV_PROFILE_COUNTER(NATRecvWait,"Time spent in NATRecv worker in waiting of free RX buffers");
119DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue");
120DRV_COUNTING_COUNTER(QueuePktDropped, "counting packet drops by PDM Queue");
121DRV_COUNTING_COUNTER(ConsumerFalse, "counting consumer's reject number to process the queue's item");
122# endif
123#endif /*!COUNTERS_INIT*/
124
125#ifdef DRV_COUNTING_COUNTER
126# undef DRV_COUNTING_COUNTER
127#endif
128
129#ifdef DRV_PROFILE_COUNTER
130# undef DRV_PROFILE_COUNTER
131#endif
132
133#ifdef COUNTING_COUNTER
134# undef COUNTING_COUNTER
135#endif
136
137#ifdef PROFILE_COUNTER
138# undef PROFILE_COUNTER
139#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette