Initial revision
This commit is contained in:
119
perfmon.tex
Normal file
119
perfmon.tex
Normal file
@ -0,0 +1,119 @@
|
||||
\subsection{Performance Monitor}
|
||||
This object implements a performance monitor for SICS. Please note that SICS
|
||||
performance is determined not only by processor speed but by a whole range
|
||||
of factors:
|
||||
\begin{itemize}
|
||||
\item Processor speed and memory.
|
||||
\item Speed of network connctions to hardware devices.
|
||||
\item Number of clients connected.
|
||||
\end{itemize}
|
||||
|
||||
The PerfMonTask is called from the SICS task modules main loop. It will then
|
||||
increment a cycle counter and check if a predefined intergration time has
|
||||
passed. If so a new
|
||||
value for cycle per seconds will be calculated. This is also the main
|
||||
output of PerfMon. PerfMon implements a callback interface in order to allow
|
||||
automatical notification about system performance.
|
||||
|
||||
PerfMon has a little datastructure:
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap1}
|
||||
$\langle$pdata {\footnotesize ?}$\rangle\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ typedef struct __PerfMon {@\\
|
||||
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
||||
\mbox{}\verb@ pICallBack pCall;@\\
|
||||
\mbox{}\verb@ int iLog; /* flag for@\\
|
||||
\mbox{}\verb@ serverlog writing */ @\\
|
||||
\mbox{}\verb@ float fCPS; /* cycles per seconds */@\\
|
||||
\mbox{}\verb@ int iInteg; /* integration time */@\\
|
||||
\mbox{}\verb@ int iCount;@\\
|
||||
\mbox{}\verb@ time_t tLast; /* last time calculated */@\\
|
||||
\mbox{}\verb@ time_t tTarget; /* next target time */@\\
|
||||
\mbox{}\verb@ int iEnd;@\\
|
||||
\mbox{}\verb@ }PerfMon;@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-1ex}
|
||||
\footnotesize\addtolength{\baselineskip}{-1ex}
|
||||
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
|
||||
\item Macro referenced in scrap ?.
|
||||
\end{list}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
The interface consists of the following functions:
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap2}
|
||||
$\langle$pInter {\footnotesize ?}$\rangle\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ typedef struct __PerfMon *pPerfMon;@\\
|
||||
\mbox{}\verb@/*---------------------- live and death ----------------------------------*/@\\
|
||||
\mbox{}\verb@ pPerfMon CreatePerfMon(int iInteg);@\\
|
||||
\mbox{}\verb@ void DeletePerfMon(void *pData);@\\
|
||||
\mbox{}\verb@/*---------------------- increment ---------------------------------------*/@\\
|
||||
\mbox{}\verb@ int IncrementPerfMon(pPerfMon self);@\\
|
||||
\mbox{}\verb@/*------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@ float GetPerformance(pPerfMon self);@\\
|
||||
\mbox{}\verb@/*------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@ int PerfMonWrapper(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
|
||||
\mbox{}\verb@ int argc, char *argv[]);@\\
|
||||
\mbox{}\verb@/*-----------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@ int PerfMonTask(void *pPerf);@\\
|
||||
\mbox{}\verb@ void PerfMonSignal(void *pPerf, int iSignal, void *pSigData); @\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-1ex}
|
||||
\footnotesize\addtolength{\baselineskip}{-1ex}
|
||||
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
|
||||
\item Macro referenced in scrap ?.
|
||||
\end{list}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
There is really not much to this.
|
||||
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap3}
|
||||
\verb@"perfmon.h"@ {\footnotesize ? }$\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/*-------------------------------------------------------------------------@\\
|
||||
\mbox{}\verb@ P E R F M O N@\\
|
||||
\mbox{}\verb@ A performance monitor for SICS. Maintains and calculates a value for@\\
|
||||
\mbox{}\verb@ cycles per seconds. @\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ Mark Koennecke, Juli 1997@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ copyright: see implementation file@\\
|
||||
\mbox{}\verb@---------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@#ifndef SICSPERFMON@\\
|
||||
\mbox{}\verb@#define SICSPERFMON@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@@$\langle$pInter {\footnotesize ?}$\rangle$\verb@@\\
|
||||
\mbox{}\verb@#endif@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-2ex}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
||||
\begin{flushleft} \small
|
||||
\begin{minipage}{\linewidth} \label{scrap4}
|
||||
\verb@"perfmon.i"@ {\footnotesize ? }$\equiv$
|
||||
\vspace{-1ex}
|
||||
\begin{list}{}{} \item
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@/*--------------------------------------------------------------------------@\\
|
||||
\mbox{}\verb@ The P E R F M O N datastructure.@\\
|
||||
\mbox{}\verb@@\\
|
||||
\mbox{}\verb@ Mark Koennecke, Juli 1997@\\
|
||||
\mbox{}\verb@---------------------------------------------------------------------------*/@\\
|
||||
\mbox{}\verb@@$\langle$pdata {\footnotesize ?}$\rangle$\verb@@\\
|
||||
\mbox{}\verb@@$\diamond$
|
||||
\end{list}
|
||||
\vspace{-2ex}
|
||||
\end{minipage}\\[4ex]
|
||||
\end{flushleft}
|
Reference in New Issue
Block a user