#include <connector-trace.h>
Inheritance diagram for ConnectorTrace:
Public Member Functions | |
ConnectorTrace () | |
virtual | ~ConnectorTrace () |
virtual int | command (int argc, const char *const *argv) |
int | depth () |
virtual void | handle (Event *e) |
Static Public Member Functions | |
static void | addTracer (ClMessageTracer *tr) |
static void | addCommonTracer (ClMessageTracer *tr) |
Protected Member Functions | |
void | writeTrace (char *s,...) |
void | vWriteTrace (char *s, va_list ap) |
void | dump () |
void | write_nam_trace (const char *s) |
void | annotate (const char *s) |
void | trace (ClMessage *m) |
void | traceSync (ClMessage *m) |
Protected Attributes | |
BaseTrace * | pt_ |
int | depth_ |
int | debug_ |
char | dirToPlugin_ |
char | dirToNodeCore_ |
char | dirUp_ |
char | dirDown_ |
char | preambleToPlugin_ [MAX_PREAMBLE_LENGTH] |
char | preambleToNodeCore_ [MAX_PREAMBLE_LENGTH] |
char | preambleUp_ [MAX_PREAMBLE_LENGTH] |
char | preambleDown_ [MAX_PREAMBLE_LENGTH] |
Static Protected Attributes | |
static ClTracer * | clTr_ = 0 |
Friends | |
class | ClMessageTracer |
Definition at line 66 of file connector-trace.h.
ConnectorTrace::ConnectorTrace | ( | ) |
ConnectorTrace constructor
Definition at line 65 of file connector-trace.cc.
References debug_, DEFAULTDEPTH, depth_, and pt_.
ConnectorTrace::~ConnectorTrace | ( | ) | [virtual] |
int ConnectorTrace::command | ( | int | argc, | |
const char *const * | argv | |||
) | [virtual] |
TCL command interpreter. It implements the following OTcl methods:
argc | number of arguments in argv | |
argv | array of strings which are the comand parameters (Note that argv[0] is the name of the object) |
Reimplemented in Bin, ChSAP, ClSAP, and SAP.
Definition at line 82 of file connector-trace.cc.
References annotate(), dirDown_, dirToNodeCore_, dirToPlugin_, dirUp_, preambleDown_, preambleToNodeCore_, preambleToPlugin_, preambleUp_, pt_, and write_nam_trace().
Referenced by SAP::command(), ClSAP::command(), and Bin::command().
Here is the call graph for this function:
int ConnectorTrace::depth | ( | ) |
Return the current value of depth in tracing
Definition at line 196 of file connector-trace.cc.
References depth_.
void ConnectorTrace::handle | ( | Event * | e | ) | [virtual] |
This method is called when the ConnectorTrace has been scheduled in order to give a delay to a ClMessage
e | pointer to the event which has this ConnectorTrace for handler |
Reimplemented in Bin, ChSAP, ClSAP, and SAP.
Definition at line 253 of file connector-trace.cc.
void ConnectorTrace::addTracer | ( | ClMessageTracer * | tr | ) | [static] |
Adds a new tracer to the cross layer message tracer list (clTr_). The given tracer is used only when ClMessage type is equal to the tracer clType attribute
tr | a pointer to the tracer instance which has to insert in the tracer list |
Definition at line 49 of file connector-trace.cc.
References ClTracer::addTracer(), and clTr_.
Referenced by Mphymaccltracer_Init().
Here is the call graph for this function:
void ConnectorTrace::addCommonTracer | ( | ClMessageTracer * | tr | ) | [static] |
Adds a common tracer to the cross layer message tracer list (clTr_). This tracer will be used to process all the ClMessage which pass thorugh the ClSap
tr | a pointer to the tracer instance which has to insert in the tracer list |
Definition at line 56 of file connector-trace.cc.
References ClTracer::addCommonTracer(), and clTr_.
Here is the call graph for this function:
void ConnectorTrace::writeTrace | ( | char * | s, | |
... | ||||
) | [protected] |
Write down the trace requested
s | source of the trace | |
... | extended input format for (i.e., writes a sequence of arguments to the given buffer formatted as the format argument specifies) |
Definition at line 228 of file connector-trace.cc.
References BASICTRACE_BUFFERLEN, and pt_.
Referenced by Bin::drop(), SAP::trace(), trace(), and traceSync().
void ConnectorTrace::vWriteTrace | ( | char * | s, | |
va_list | ap | |||
) | [protected] |
Write down the trace requested
s | source of the trace | |
ap | extended input format for (i.e., writes a sequence of arguments to the given buffer formatted as the format argument specifies) |
Definition at line 238 of file connector-trace.cc.
References BASICTRACE_BUFFERLEN, and pt_.
Referenced by Tracer::writeTrace(), and ClMessageTracer::writeTrace().
void ConnectorTrace::dump | ( | ) | [protected] |
Empty the buffer
Definition at line 245 of file connector-trace.cc.
References pt_.
Referenced by Bin::drop(), SAP::trace(), trace(), and traceSync().
void ConnectorTrace::write_nam_trace | ( | const char * | s | ) | [protected] |
Write down the requested nam trace
s | string to write down |
Definition at line 202 of file connector-trace.cc.
References pt_.
Referenced by command().
void ConnectorTrace::annotate | ( | const char * | s | ) | [protected] |
Write down the annotation specified in the parameter
s | annotation to write down |
Definition at line 208 of file connector-trace.cc.
References pt_.
Referenced by command().
void ConnectorTrace::trace | ( | ClMessage * | m | ) | [protected] |
Write a line in the system trace file which contains the trace information of a ClMessage
m | pointer to the ClMessage which has to be traced |
Reimplemented in SAP.
Definition at line 257 of file connector-trace.cc.
References clTr_, dirDown_, ClMessage::direction(), dirToNodeCore_, dirToPlugin_, dirUp_, dump(), preambleDown_, preambleToNodeCore_, preambleToPlugin_, preambleUp_, TOMODULE, TONODECORE, ClTracer::trace(), UP, and writeTrace().
Referenced by ClSAP::handle(), ClSAP::sendClLayer(), ClSAP::sendModule(), and SAP::trace().
Here is the call graph for this function:
void ConnectorTrace::traceSync | ( | ClMessage * | m | ) | [protected] |
Write a line in the system trace file which contains the trace information of a synchronous ClMessage
m | pointer to the ClMessage which has to be traced |
Definition at line 272 of file connector-trace.cc.
References clTr_, ClMessage::direction(), dirToNodeCore_, dirToPlugin_, dump(), preambleToNodeCore_, preambleToPlugin_, TONODECORE, ClTracer::trace(), and writeTrace().
Referenced by ClSAP::sendSynchronousClLayer(), SAP::sendSynchronousDown(), ClSAP::sendSynchronousModule(), and SAP::sendSynchronousUp().
Here is the call graph for this function:
friend class ClMessageTracer [friend] |
ClMessageTracer is a friend class of ConnectorTrace because it can be able to write string in the trace file
Definition at line 73 of file connector-trace.h.
BaseTrace* ConnectorTrace::pt_ [protected] |
Support for pkt tracing
Definition at line 200 of file connector-trace.h.
Referenced by annotate(), command(), ConnectorTrace(), dump(), vWriteTrace(), write_nam_trace(), writeTrace(), and ~ConnectorTrace().
int ConnectorTrace::depth_ [protected] |
Define the level of depth of tracing
Reimplemented in Bin.
Definition at line 202 of file connector-trace.h.
Referenced by ConnectorTrace(), depth(), ChSAP::sendDown(), and ChSAP::sendUp().
int ConnectorTrace::debug_ [protected] |
Define the level of debug (i.e., for verbosity trace during the simulaztion)
Definition at line 204 of file connector-trace.h.
Referenced by ConnectorTrace(), Bin::drop(), SAP::handle(), ChSAP::handle(), ChSAP::sendDown(), SAP::sendUp(), ChSAP::sendUp(), and SAP::trace().
ClTracer * ConnectorTrace::clTr_ = 0 [static, protected] |
The ClMessage tracer list
Definition at line 206 of file connector-trace.h.
Referenced by addCommonTracer(), addTracer(), Bin::drop(), trace(), and traceSync().
char ConnectorTrace::dirToPlugin_ [protected] |
Prefix used in the trace of a ClMessage if its direction is to Plugin
Definition at line 209 of file connector-trace.h.
Referenced by command(), trace(), and traceSync().
char ConnectorTrace::dirToNodeCore_ [protected] |
Prefix used in the trace of a ClMessage if its direction is to NodeCore
Definition at line 211 of file connector-trace.h.
Referenced by command(), trace(), and traceSync().
char ConnectorTrace::dirUp_ [protected] |
Prefix used in the trace of a ClMessage if its direction is to the up module
Definition at line 213 of file connector-trace.h.
Referenced by command(), SAP::trace(), and trace().
char ConnectorTrace::dirDown_ [protected] |
Prefix used in the trace of a ClMessage if its direction is to the down module
Definition at line 215 of file connector-trace.h.
Referenced by command(), SAP::trace(), and trace().
char ConnectorTrace::preambleToPlugin_[MAX_PREAMBLE_LENGTH] [protected] |
String added before dirToPlugin_ in the trace of the ClMessage (used if the ClMessage direction is to Plugin)
Definition at line 217 of file connector-trace.h.
Referenced by command(), trace(), and traceSync().
char ConnectorTrace::preambleToNodeCore_[MAX_PREAMBLE_LENGTH] [protected] |
String added before dirToNodeCore_ in the trace of the ClMessage (used if the ClMessage direction is to NodeCore)
Definition at line 219 of file connector-trace.h.
Referenced by command(), trace(), and traceSync().
char ConnectorTrace::preambleUp_[MAX_PREAMBLE_LENGTH] [protected] |
String added before dirUp_ in the trace of the ClMessage (used if the ClMessage direction is up)
Definition at line 221 of file connector-trace.h.
Referenced by command(), SAP::trace(), and trace().
char ConnectorTrace::preambleDown_[MAX_PREAMBLE_LENGTH] [protected] |
String added before dirDown_ in the trace of the ClMessage (used if the ClMessage direction is down)
Definition at line 223 of file connector-trace.h.
Referenced by command(), SAP::trace(), and trace().