Instrumentation.h File Reference

#include <sys/time.h>
#include <stack/stack.h>
#include "../constants.h"

Include dependency graph for Instrumentation.h:

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

Go to the source code of this file.

Data Structures

struct  _InstState_
 this is a state More...
struct  _InstrumentationData
 this holds the instrumentation data More...

Defines

#define TIMER_NUM_VOID_STATES   9
 WARNING: if you change the number of states above, change here also!
#define INST_DIR   "instrumentation"

Typedefs

typedef _InstState_ InstState
 this is a state
typedef _InstrumentationData InstData
 this holds the instrumentation data

Enumerations

enum  TimerState {
  TIMER_INIT = 0, TIMER_PROC, TIMER_READ, TIMER_WRITE,
  TIMER_WRITE_BLOCKED, TIMER_LS, TIMER_FINALIZE, TIMER_VOID,
  TIMER_END
}
 The program can be in either of these states proc means processing read means entered a receive function write means entered a write function init means is initializing(initFilter) finalizing mean is in finalize(finalizeFilter) void means time void used for its own end is used to end timing results process is the sum of proc, read and write. More...

Functions

InstDatainstCreate ()
 Starts the instrumentation data, zeroing everything.
void instDestroy (InstData **InstDataPointerAddress)
 Destroys the Instrumentation data, NULLing the pointer.
void instSetDir (InstData *inst, char *dir)
 Sets instrumentation directory, where we write instrumentation data.
void instEnterState (InstData *inst, InstState *state)
 enter a state, which can be a void state or am user state.
void instSwitchState (InstData *inst, InstState *state)
 switches the state, which means the current one is computed but not stacked, and current is set to the new one
void instLeaveState (InstData *inst)
 leaves the current state, computing times for it.
void instSaveTimings (InstData *inst, char *filename, char *label)
 Saves all instrumentation data to a file, appending time there.
void instSetUserStates (InstData *inst, char **userStatesArray, int numStates)
 Adds user states to the instrumentation.


Define Documentation

#define INST_DIR   "instrumentation"
 

Definition at line 32 of file Instrumentation.h.

#define TIMER_NUM_VOID_STATES   9
 

WARNING: if you change the number of states above, change here also!

Definition at line 24 of file Instrumentation.h.

Referenced by instCreate(), and instSaveTimings().


Typedef Documentation

typedef struct _InstrumentationData InstData
 

this holds the instrumentation data

typedef struct _InstState_ InstState
 

this is a state


Enumeration Type Documentation

enum TimerState
 

The program can be in either of these states proc means processing read means entered a receive function write means entered a write function init means is initializing(initFilter) finalizing mean is in finalize(finalizeFilter) void means time void used for its own end is used to end timing results process is the sum of proc, read and write.

Enumerator:
TIMER_INIT 
TIMER_PROC 
TIMER_READ 
TIMER_WRITE 
TIMER_WRITE_BLOCKED 
TIMER_LS 
TIMER_FINALIZE 
TIMER_VOID 
TIMER_END 

Definition at line 18 of file Instrumentation.h.


Function Documentation

InstData* instCreate  ) 
 

Starts the instrumentation data, zeroing everything.

Returns:
the instrumentation data created

Definition at line 9 of file Instrumentation.c.

References _InstState_::isUserState, _InstState_::stateName, TIMER_NUM_VOID_STATES, _InstState_::timing, and _InstrumentationData::voidStates.

Referenced by createFilterData().

void instDestroy InstData **  InstDataPointerAddress  ) 
 

Destroys the Instrumentation data, NULLing the pointer.

Parameters:
InstDataPointerAddress the address of the Instrumentation data pointer, which will be NULL after this call

Definition at line 34 of file Instrumentation.c.

References _InstrumentationData::numUserStates, _InstState_::stateName, and _InstrumentationData::userStates.

void instEnterState InstData inst,
InstState state
 

enter a state, which can be a void state or am user state.

The current state timings are computed and is stacked, so we can return to it later

Parameters:
state the state we are changing to
isUserState is this state a user state?

Definition at line 93 of file Instrumentation.c.

References _InstrumentationData::currentState, _InstrumentationData::stackedStates, stPush(), _InstrumentationData::tv, and _InstrumentationData::tz.

Referenced by dsInstEnterState(), dsMCast(), dsReadBuffer(), dsReadNonBlockingBuffer(), dsSend(), and dsWriteBuffer().

Here is the call graph for this function:

void instLeaveState InstData inst  ) 
 

leaves the current state, computing times for it.

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

Parameters:
inst the instrumentation data

Definition at line 107 of file Instrumentation.c.

References _InstrumentationData::currentState, _InstrumentationData::stackedStates, stPop(), _InstrumentationData::tv, and _InstrumentationData::tz.

Referenced by dsInstLeaveState(), dsReadBuffer(), dsReadNonBlockingBuffer(), dsSend(), and dsWriteBuffer().

Here is the call graph for this function:

void instSaveTimings InstData inst,
char *  filename,
char *  label
 

Saves all instrumentation 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 135 of file Instrumentation.c.

References _InstrumentationData::instDir, MAX_FNAME_LENGTH, MAX_IDIR_LENGTH, _InstState_::stateName, TIMER_NUM_VOID_STATES, _InstState_::timing, and _InstrumentationData::voidStates.

void instSetDir InstData inst,
char *  dir
 

Sets instrumentation directory, where we write instrumentation data.

Its usually instrumentation/#-#-#... where # is the number of instances each filter has in the pipeline

Parameters:
dir the directory

Definition at line 49 of file Instrumentation.c.

References _InstrumentationData::instDir, and MAX_IDIR_LENGTH.

void instSetUserStates InstData inst,
char **  userStates,
int  numStates
 

Adds user states to the instrumentation.

Todo:
Copy the data from user

Definition at line 165 of file Instrumentation.c.

References _InstState_::isUserState, _InstrumentationData::numUserStates, _InstState_::stateName, _InstState_::timing, and _InstrumentationData::userStates.

Referenced by dsInstSetStates().

void instSwitchState InstData inst,
InstState state
 

switches the state, which means the current one is computed but not stacked, and current is set to the new one

Definition at line 126 of file Instrumentation.c.

References _InstrumentationData::currentState, _InstrumentationData::tv, and _InstrumentationData::tz.

Referenced by dsInstSwitchState().


Generated on Tue Jan 17 19:24:21 2006 for Void by  doxygen 1.4.6