Instrumentation.c File Reference

#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Instrumentation.h"

Include dependency graph for Instrumentation.c:

Go to the source code of this file.

Defines

#define _INSTRUMENTATION_C_

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 instLeaveState (InstData *inst)
 leaves the current state, computing times for it.
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 instSaveTimings (InstData *inst, char *filename, char *label)
 Saves all instrumentation data to a file, appending time there.
void instSetUserStates (InstData *inst, char **userStates, int numStates)
 Adds user states to the instrumentation.


Define Documentation

#define _INSTRUMENTATION_C_
 

Definition at line 1 of file Instrumentation.c.


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:15 2006 for Void by  doxygen 1.4.6