1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3 <title>oscl_socket_stats.h Source File</title> 4 <link href="doxygen.css" rel="stylesheet" type="text/css"> 5 </head><body> 6 <!-- Generated by Doxygen 1.2.18 --> 7 <center> 8 <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> 9 <hr><h1>oscl_socket_stats.h</h1><a href="oscl__socket__stats_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 10 00002 11 00003 <span class="preprocessor">#ifndef OSCL_SOCKET_STATS_H_INCLUDED</span> 12 00004 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SOCKET_STATS_H_INCLUDED</span> 13 00005 <span class="preprocessor"></span> 14 00009 <span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span> 15 00010 <span class="preprocessor">#include "<a class="code" href="oscl__vector_8h.html">oscl_vector.h</a>"</span> 16 00011 <span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span> 17 00012 <span class="preprocessor">#include "<a class="code" href="oscl__mutex_8h.html">oscl_mutex.h</a>"</span> 18 00013 19 <a name="l00014"></a><a class="code" href="oscl__socket__stats_8h.html#a23">00014</a> <span class="keyword">enum</span> <a class="code" href="oscl__socket__stats_8h.html#a23">TOsclSocketStatEvent</a> 20 00015 { 21 00016 <span class="comment">//Request/Method AO events</span> 22 00017 <a class="code" href="oscl__socket__stats_8h.html#a23a2">EOsclSocket_RequestAO_Success</a> 23 00018 , <a class="code" href="oscl__socket__stats_8h.html#a23a3">EOsclSocket_RequestAO_Canceled</a> 24 00019 , <a class="code" href="oscl__socket__stats_8h.html#a23a4">EOsclSocket_RequestAO_Error</a> 25 00020 , <a class="code" href="oscl__socket__stats_8h.html#a23a5">EOsclSocket_RequestAO_Timeout</a> 26 00021 <span class="comment">//Server events</span> 27 00022 , <a class="code" href="oscl__socket__stats_8h.html#a23a6">EOsclSocket_ServRequestIssued</a> 28 00023 , <a class="code" href="oscl__socket__stats_8h.html#a23a7">EOsclSocket_ServPoll</a> 29 00024 , <a class="code" href="oscl__socket__stats_8h.html#a23a8">EOsclSocket_OS</a> 30 00025 , <a class="code" href="oscl__socket__stats_8h.html#a23a9">EOsclSocket_Readable</a> 31 00026 , <a class="code" href="oscl__socket__stats_8h.html#a23a10">EOsclSocket_Writable</a> 32 00027 , <a class="code" href="oscl__socket__stats_8h.html#a23a11">EOsclSocket_Except</a> 33 00028 , <a class="code" href="oscl__socket__stats_8h.html#a23a12">EOsclSocket_DataRecv</a> 34 00029 , <a class="code" href="oscl__socket__stats_8h.html#a23a13">EOsclSocket_DataSent</a> 35 00030 , <a class="code" href="oscl__socket__stats_8h.html#a23a14">EOsclSocket_ServRequestComplete</a> 36 00031 , <a class="code" href="oscl__socket__stats_8h.html#a23a15">EOsclSocket_ServRequestCancelIssued</a> 37 00032 <span class="comment">//loop socket events</span> 38 00033 , <a class="code" href="oscl__socket__stats_8h.html#a23a16">EOsclSocketServ_LoopsockOk</a> 39 00034 , <a class="code" href="oscl__socket__stats_8h.html#a23a17">EOsclSocketServ_LoopsockError</a> 40 00035 }; 41 00036 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> TPVSocketStatStr[] = 42 00037 { 43 00038 <span class="comment">//Request/Method AO events</span> 44 00039 <span class="stringliteral">"AO_Success"</span> 45 00040 , <span class="stringliteral">"AO_Canceled"</span> 46 00041 , <span class="stringliteral">"AO_Error"</span> 47 00042 , <span class="stringliteral">"AO_Timeout"</span> 48 00043 <span class="comment">//Server events</span> 49 00044 , <span class="stringliteral">"Serv_ReqIssued"</span> 50 00045 , <span class="stringliteral">"Serv_Poll"</span> 51 00046 , <span class="stringliteral">"Serv_OS_Op"</span> 52 00047 , <span class="stringliteral">"Serv_Readable"</span> 53 00048 , <span class="stringliteral">"Serv_Writeable"</span> 54 00049 , <span class="stringliteral">"Serv_Except!"</span> 55 00050 , <span class="stringliteral">"Serv_DataRecv'd"</span> 56 00051 , <span class="stringliteral">"Serv_DataSent"</span> 57 00052 , <span class="stringliteral">"Serv_ReqComplete"</span> 58 00053 , <span class="stringliteral">"Serv_ReqCancel"</span> 59 00054 <span class="comment">//loop socket events</span> 60 00055 , <span class="stringliteral">"Loopsock_OK"</span> 61 00056 , <span class="stringliteral">"Loopsock_Err"</span> 62 00057 } ; 63 00058 64 <a name="l00059"></a><a class="code" href="oscl__socket__stats_8h.html#a24">00059</a> <span class="keyword">enum</span> <a class="code" href="oscl__socket__stats_8h.html#a24">TOsclSocketServStatEvent</a> 65 00060 { 66 00061 <span class="comment">//select loop events</span> 67 00062 <a class="code" href="oscl__socket__stats_8h.html#a24a18">EOsclSocketServ_SelectNoActivity</a> = 0 68 00063 , <a class="code" href="oscl__socket__stats_8h.html#a24a19">EOsclSocketServ_SelectActivity</a> 69 00064 , <a class="code" href="oscl__socket__stats_8h.html#a24a20">EOsclSocketServ_SelectRescheduleAsap</a> 70 00065 , <a class="code" href="oscl__socket__stats_8h.html#a24a21">EOsclSocketServ_SelectReschedulePoll</a> 71 00066 , <a class="code" href="oscl__socket__stats_8h.html#a24a22">EOsclSocketServ_LastEvent</a> 72 00067 }; 73 00068 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> TPVSocketServStatStr[] = 74 00069 { 75 00070 <span class="stringliteral">"Select_No"</span> 76 00071 , <span class="stringliteral">"Select_Yes"</span> 77 00072 , <span class="stringliteral">"Select_Resched_Asap"</span> 78 00073 , <span class="stringliteral">"Select_Resched_Poll"</span> 79 00074 } ; 80 00075 81 00076 <span class="preprocessor">#include "<a class="code" href="oscl__socket__tuneables_8h.html">oscl_socket_tuneables.h</a>"</span> 82 00077 <span class="preprocessor">#if(PV_OSCL_SOCKET_STATS_LOGGING)</span> 83 00078 <span class="preprocessor"></span> 84 00079 <span class="keyword">class </span><a class="code" href="classPVLogger.html">PVLogger</a>; 85 00080 <span class="keyword">class </span>OsclSocketStatEventEntry 86 00081 { 87 00082 <span class="keyword">public</span>: 88 00083 OsclSocketStatEventEntry(<a class="code" href="oscl__socket__stats_8h.html#a23">TOsclSocketStatEvent</a> aEvent, uint32 aTime, int32 aParam) 89 00084 : iEvent(aEvent) 90 00085 , iTicks(aTime) 91 00086 , iParam(aParam) 92 00087 {} 93 00088 <a class="code" href="oscl__socket__stats_8h.html#a23">TOsclSocketStatEvent</a> iEvent; 94 00089 uint32 iTicks; 95 00090 int32 iParam; 96 00091 }; 97 00092 98 00093 <span class="preprocessor">#include "<a class="code" href="oscl__socket__types_8h.html">oscl_socket_types.h</a>"</span> 99 00094 100 00095 <span class="preprocessor">#define OsclSocketStats_NUM_ACTIVE_REQUESTS EPVSocket_Last</span> 101 00096 <span class="preprocessor"></span> 102 00097 <span class="comment">//Define the maximum number of polling events that will be logged.</span> 103 00098 <span class="comment">//Additional poll events will be counted but not logged individually.</span> 104 00099 <span class="preprocessor">#define OsclSocketStats_MAX_POLL_EVENTS 100</span> 105 00100 <span class="preprocessor"></span> 106 00101 <span class="keyword">class </span>OsclSocketStats 107 00102 { 108 00103 <span class="keyword">public</span>: 109 00104 OsclSocketStats(); 110 00105 ~OsclSocketStats(); 111 00106 <span class="keywordtype">void</span> ShowTuneables(); 112 00107 <span class="keywordtype">void</span> Add(<a class="code" href="oscl__socket__types_8h.html#a19">TPVSocketFxn</a>, <a class="code" href="oscl__socket__stats_8h.html#a23">TOsclSocketStatEvent</a>, int32 aParam = (-1)); 113 00108 <span class="keywordtype">void</span> Log(<a class="code" href="oscl__socket__types_8h.html#a19">TPVSocketFxn</a>); 114 00109 <span class="keywordtype">void</span> Log(); 115 00110 <span class="keywordtype">void</span> Clear(<a class="code" href="oscl__socket__types_8h.html#a19">TPVSocketFxn</a>); 116 00111 <span class="keywordtype">void</span> Construct(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* aContainer, <a class="code" href="group__osclbase.html#a25">OsclAny</a>*aServ); 117 00112 <span class="keywordtype">void</span> LogAndDump(); 118 00113 <span class="keyword">private</span>: 119 00114 <a class="code" href="classOscl__Vector.html">Oscl_Vector<OsclSocketStatEventEntry, OsclMemAllocator></a> iEvents[OsclSocketStats_NUM_ACTIVE_REQUESTS]; 120 00115 <a class="code" href="classOscl__Vector.html">Oscl_Vector<OsclSocketStatEventEntry, OsclMemAllocator></a> iPollEvents[OsclSocketStats_NUM_ACTIVE_REQUESTS]; 121 00116 int32 iExcessPollEvents[OsclSocketStats_NUM_ACTIVE_REQUESTS]; 122 00117 int32 iLastCompletionTime[OsclSocketStats_NUM_ACTIVE_REQUESTS]; 123 00118 <a class="code" href="classOsclThreadLock.html">OsclThreadLock</a> iLock; 124 00119 <span class="keywordtype">char</span>* iLogStr; 125 00120 <a class="code" href="classPVLogger.html">PVLogger</a>* iLogger; 126 00121 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* iSock; 127 00122 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* iServ; 128 00123 }; 129 00124 130 00125 <span class="keyword">class </span>OsclSocketServStats 131 00126 { 132 00127 <span class="keyword">public</span>: 133 00128 OsclSocketServStats(); 134 00129 ~OsclSocketServStats(); 135 00130 <span class="keywordtype">void</span> Add(<a class="code" href="oscl__socket__stats_8h.html#a24">TOsclSocketServStatEvent</a>); 136 00131 <span class="keywordtype">void</span> Construct(<a class="code" href="group__osclbase.html#a25">OsclAny</a>*aServ); 137 00132 <span class="keywordtype">void</span> LogAndDump(); 138 00133 <span class="keyword">private</span>: 139 00134 <span class="keywordtype">void</span> Log(<a class="code" href="oscl__socket__stats_8h.html#a24">TOsclSocketServStatEvent</a>); 140 00135 <span class="keywordtype">void</span> Clear(); 141 00136 <span class="keywordtype">void</span> ShowTuneables(); 142 00137 uint32 iEvents[<a class="code" href="oscl__socket__stats_8h.html#a24a22">EOsclSocketServ_LastEvent</a>]; 143 00138 <a class="code" href="classPVLogger.html">PVLogger</a>* iLogger; 144 00139 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* iServ; 145 00140 }; 146 00141 147 00142 <span class="preprocessor">#endif</span> 148 00143 <span class="preprocessor"></span><span class="preprocessor">#endif</span> 149 00144 <span class="preprocessor"></span> 150 00145 151 00146 152 </pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 153 <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 154 </small></address> 155 </body> 156 </html> 157