tracer.h File Reference

#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
#include <stack/stack.h>
#include <dbLkList/dbLkList.h>

Include dependency graph for tracer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _TrcAttribute_
 This is a state attribute. More...
struct  _TrcState_
 This is a state. More...
struct  _TrcData_
 This holds the tracing data. More...

Defines

#define MAXSAVEDSTATES   1000
#define SEPARATOR   " "

Typedefs

typedef _TrcAttribute_ TrcAttribute
 This is a state attribute.
typedef _TrcState_ TrcState
 This is a state.
typedef _TrcData_ TrcData
 This holds the tracing data.

Functions

TrcDatatrcCreateData (char *filename)
 Starts the tracing data, zeroing everything.
void trcEnterState (TrcData *trc, char *types,...)
 Enters a specific state, setting the values of the attributes.
void trcDestroyData (TrcData **trcPointer)
 Destroys the Tracing data, NULLing the pointer.
void trcLeaveState (TrcData *trc,...)
 leaves the current state, computing times for it.
void trcFlush (TrcData *trc)
 Saves all tracing data to a file, appending time there.
int * trcIArrayToTrc (int size, int *array)
void trcResetCurrentState (TrcData *trc)
 Reset the initial time of the current state, as if trcEnterState was called again ( but no other state is created ).


Define Documentation

#define MAXSAVEDSTATES   1000
 

Definition at line 12 of file tracer.h.

#define SEPARATOR   " "
 

Definition at line 14 of file tracer.h.

Referenced by trcFlush().


Typedef Documentation

typedef struct _TrcAttribute_ TrcAttribute
 

This is a state attribute.

typedef struct _TrcData_ TrcData
 

This holds the tracing data.

typedef struct _TrcState_ TrcState
 

This is a state.


Function Documentation

TrcData* trcCreateData char *  filename  ) 
 

Starts the tracing data, zeroing everything.

Returns:
the tracing data created

Definition at line 3 of file tracer.c.

References _TrcData_::currentState, _TrcData_::firstFlush, _TrcData_::initTime, listCreate(), _TrcData_::numSavedStates, _TrcData_::numStackedStates, _TrcData_::savedStates, _TrcData_::stackedStates, stCreate(), and _TrcData_::tracefile.

Referenced by createFilterData().

Here is the call graph for this function:

void trcDestroyData TrcData **  trcPointer  ) 
 

Destroys the Tracing data, NULLing the pointer.

Parameters:
trcPointer the address of the Tracing data pointer, which will be NULL after this call

Definition at line 24 of file tracer.c.

References trcFlush(), and trcLeaveState().

Referenced by dsExit().

Here is the call graph for this function:

void trcEnterState TrcData trc,
char *  types,
  ...
 

Enters a specific state, setting the values of the attributes.

Parameters:
id = a pointer to an TrcData structure returned by a previous trcCreateData call;
types = a null terminated string of length = numAttributes specifying the types of the incoming attributes, as above: i = fixed integer s = fixed string

Definition at line 53 of file tracer.c.

References _TrcState_::numAttributes, and _TrcState_::numPosAttributes.

Referenced by dsCloseOutputPort(), dsCreateTask(), dsEndTask(), dsExit(), dsGetCurrentTask(), dsGetInputPortByName(), dsGetLocalInstances(), dsGetMachineMemory(), dsGetMyRank(), dsGetNumReaders(), dsGetNumWriters(), dsGetOutputPortByName(), dsGetTotalInstances(), dsInitPack(), dsInitReceive(), dsPackData(), dsProbe(), dsReadBuffer(), dsReadNonBlockingBuffer(), dsSetCurrentTask(), dsUnpackData(), dsWriteBuffer(), and dsWritePackedBuffer().

void trcFlush TrcData trc  ) 
 

Saves all tracing data to a file, appending time there.

Parameters:
filename the name of the file to save
label a label to write with the timing results

Definition at line 254 of file tracer.c.

References _TrcData_::firstFlush, _TrcData_::initTime, listRemoveHead(), _TrcData_::numSavedStates, _TrcData_::savedStates, SEPARATOR, and _TrcData_::tracefile.

Referenced by trcDestroyData().

Here is the call graph for this function:

int* trcIArrayToTrc int  size,
int *  array
 

Definition at line 288 of file tracer.c.

void trcLeaveState TrcData trc,
  ...
 

leaves the current state, computing times for it.

The current state is set to the Top of the stack, which is poped

Parameters:
trc Pointer to tracing data

Definition at line 130 of file tracer.c.

References _TrcState_::attributes, _TrcData_::currentState, _TrcState_::endRusage, _TrcState_::endTime, _TrcState_::numAttributes, _TrcState_::numPosAttributes, _TrcData_::numStackedStates, _TrcData_::stackedStates, stPop(), _TrcAttribute_::type, and _TrcAttribute_::value.

Referenced by dsCloseOutputPort(), dsCreateTask(), dsEndTask(), dsExit(), dsGetCurrentTask(), dsGetInputPortByName(), dsGetLocalInstances(), dsGetMachineMemory(), dsGetMyRank(), dsGetNumReaders(), dsGetNumWriters(), dsGetOutputPortByName(), dsGetTotalInstances(), dsInitPack(), dsInitReceive(), dsPackData(), dsProbe(), dsReadBuffer(), dsReadNonBlockingBuffer(), dsSetCurrentTask(), dsUnpackData(), dsWriteBuffer(), dsWritePackedBuffer(), and trcDestroyData().

Here is the call graph for this function:

void trcResetCurrentState TrcData trc  ) 
 

Reset the initial time of the current state, as if trcEnterState was called again ( but no other state is created ).

Parameters:
trc Pointer to tracing data

Definition at line 125 of file tracer.c.

References _TrcData_::currentState, and _TrcState_::initTime.

Referenced by dsReadBuffer().


Generated on Tue Jan 17 19:28:27 2006 for Void by  doxygen 1.4.6