winIDEA SDK
isys::CTestProfiler Class Reference

Description

Deprecated:
use CTestAnalyzer and CTestAnalyzerProfiler instead.

This class contains specification for profiler recording during test execution.

 

#include <CTestProfiler.h>

Inheritance diagram for isys::CTestProfiler:
isys::CTestTrace isys::CTestBase

Public Types

enum  EAreaType { DATA_AREA , CODE_AREA }
 Profiler areas. More...
 
enum  ERunMode {
  M_OFF , M_START ,
  M_RESUME
}
 Trace modes. More...
 
enum  EAnalyzerSectionId
 Ids of test specification sections.
 

Public Member Functions

 CTestProfiler ()
 Initializes new instance.
 
 CTestProfiler (const CTestBaseSPtr &parent)
 Initializes new instance. More...
 
CTestBaseSPtr createInstance (const CTestBaseSPtr &parent) const
 Creates a new empty instance of this class.
 
void assignCodeAreas (isys::CTestProfilerSPtr &src)
 This method copies code areas from src to this object.
 
void assignDataAreas (isys::CTestProfilerSPtr &src)
 This method copies code areas from src to this object.
 
bool isMerged () const
 Returns true, if the CTestSpecification section containing this object is merged. More...
 
bool isRecordingConfigEmpty ()
 Returns true, if only profiler recoding configuration is empty, that means everything except data and code areas is empty.
 
iconnect::ETristate isProfileAUX ()
 Returns true, if AUX signals should be recorded during profiler session.
 
iconnect::ETristate isExportActiveAreasOnly ()
 Returns true, when only areas with recoded activity will be exported. More...
 
iconnect::ETristate isSaveHistory ()
 Returns true, if profiler history should also be saved to output file.
 
CTestBaseListSPtr getAreas (isys::CTestProfiler::EAreaType areaType, bool isConst)
 Returns areas of the given type.
 
CTestBaseListSPtr getCodeAreas (bool isConst)
 Returns code areas specified for profiler.
 
CTestBaseListSPtr getDataAreas (bool isConst)
 Returns data areas specified for profiler.
 
size_t getAreasSize (EAreaType areaType)
 Returns the number of profiler area items.
 
int findArea (EAreaType areaType, const std::string &areaName)
 Returns index of the area or -1 if the area is not found. More...
 
int findArea (const std::string &areaName, int64_t areaValue)
 Returns index of the data area, or -1 if the area is not found. More...
 
isys::CTestProfilerStatisticsSPtr getArea (EAreaType areaType, int idx)
 Returns the requested area.
 
isys::CTestProfilerStatisticsSPtr addArea (EAreaType areaType)
 Adds empty area to the end of the list.
 
void insertArea (isys::CTestProfilerStatisticsSPtr area, EAreaType areaType, int idx)
 Adds empty area to the end of the list.
 
void removeArea (EAreaType areaType, int idx)
 Removes the requested area.
 
void swapAreas (EAreaType areaType, int idx1, int idx2)
 Swaps two areas in the list.
 
void setProfileAUX (iconnect::ETristate isProfileAUX)
 If parameter is true, then AUX signals are recorded during profiling.
 
void setExportActiveAreasOnly (iconnect::ETristate isExportActiveAreasOnly)
 If isExportActiveAreasOnly is true, then only areas with recorded activity (executed functions and modified data) will be exported. More...
 
void setSaveHistory (iconnect::ETristate isSave)
 Sets the save mode for output file. More...
 
void setCodeAreas (CTestBaseListSPtr &)
 Sets code areas for profiler.
 
void setDataAreas (CTestBaseListSPtr &)
 Sets data areas for profiler.
 
ERunMode getRunMode ()
 Returns run mode.
 
iconnect::ETristate isSlowRun ()
 Returns E_TRUE, if slow run should be used for analyzer.
 
std::string getDocumentFileName ()
 Returns name of the document to contain trace results.
 
std::string getOpenMode ()
 Returns one of the open mode strings: "r", "w", or "a".
 
iconnect::ETristate isSaveAfterTest ()
 Returns true, if the document should be saved after test.
 
std::string getTriggerName ()
 Returns the name of the trigger to be used for trace start. More...
 
std::string getExportFormat ()
 Returns the export format type. More...
 
std::string getExportFileName ()
 Returns the export file name.
 
void setRunMode (ERunMode mode)
 Sets run mode.
 
void setSlowRun (iconnect::ETristate isSlowRun)
 If parameter is true, then slow run is used for analyzer.
 
void setDocumentFileName (const std::string &docFileName)
 Sets the name of the trace document.
 
void setOpenMode (const std::string &openMode)
 Sets open mode for document. More...
 
void setSaveAfterTest (iconnect::ETristate isSave)
 Sets save operation for trace document after test.
 
void setCloseAfterTest (iconnect::ETristate isClose)
 Sets close operation for trace document after test.
 
void setTriggerName (const std::string &triggerName)
 Sets name of the trigger to be used for trace start. More...
 
void setExportFormat (const std::string &exportFormat)
 Sets export format for the trace document. More...
 
void setExportFileName (const std::string &exportFileName)
 Sets the export file name.
 
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
 
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
 
virtual std::string toString ()
 Returns object data as YAML string.
 

Static Public Member Functions

static CTestProfilerSPtr cast (CTestBaseSPtr &testBase)
 Casts the given pointer to this class.
 

Protected Member Functions

void setStaticTagsAsConst ()
 This method is called by all objects which are immediately contained in CTestSpecification, for example CTestCoverage, CTestHIL, ...
 

Member Enumeration Documentation

◆ EAreaType

Profiler areas.

Enumerator
DATA_AREA 

profiler data area

CODE_AREA 

profiler code area

◆ ERunMode

Trace modes.

Enumerator
M_OFF 

trace will not be configured or started

M_START 

start trace

M_RESUME 

Deprecated: use open mode 'a' instead, see setOpenMode().

Resumes session, currently supported only for coverage. Method setRunMode(M_RESUME) throws an exception if called on trace or profiler document.

Constructor & Destructor Documentation

◆ CTestProfiler()

isys::CTestProfiler::CTestProfiler ( const CTestBaseSPtr parent)

Initializes new instance.

Parameters
parentan instance of parent CTestSpecification class. Used only when parsing YAML declaration. Can be specified as NULL if the object is not initialized by parser.

Member Function Documentation

◆ findArea() [1/2]

int isys::CTestProfiler::findArea ( const std::string &  areaName,
int64_t  areaValue 
)

Returns index of the data area, or -1 if the area is not found.

This method searches for data areas with value set.

◆ findArea() [2/2]

int isys::CTestProfiler::findArea ( EAreaType  areaType,
const std::string &  areaName 
)

Returns index of the area or -1 if the area is not found.

Parameters
areaTypeif set to DATA_AREA, then only data areas without value set can match.
areaNamename of area.

◆ getExportFormat()

std::string isys::CTestTrace::getExportFormat ( )
inherited

Returns the export format type.

See CAnalyzerDocController for possible values.

◆ getTriggerName()

std::string isys::CTestTrace::getTriggerName ( )
inherited

Returns the name of the trigger to be used for trace start.

The trigger should be defined in winIDEA GUI.

◆ isExportActiveAreasOnly()

iconnect::ETristate isys::CTestProfiler::isExportActiveAreasOnly ( )

Returns true, when only areas with recoded activity will be exported.

Returns false, if all configured areas will be exported.

◆ isMerged()

bool isys::CTestProfiler::isMerged ( ) const
virtual

Returns true, if the CTestSpecification section containing this object is merged.


Reimplemented from isys::CTestTrace.

◆ setExportActiveAreasOnly()

void isys::CTestProfiler::setExportActiveAreasOnly ( iconnect::ETristate  isExportActiveAreasOnly)

If isExportActiveAreasOnly is true, then only areas with recorded activity (executed functions and modified data) will be exported.

Otherwise all configured areas will be exported.

◆ setExportFormat()

void isys::CTestTrace::setExportFormat ( const std::string &  exportFormat)
inherited

Sets export format for the trace document.

See CAnalyzerDocController for possible values.

◆ setOpenMode()

void isys::CTestTrace::setOpenMode ( const std::string &  openMode)
inherited

Sets open mode for document.

Parameters
openModecan be one of:
  • 'u' opens existing document, and updates its contents
  • 'w' creates new document or overwrites the existing one
  • 'a' opens existing document. Coverage will append its contents on start, while profiler and trace do not support appending yet.
  • empty string, which defaults to 'w'. Note that default values are NOT written to test specification file - that's why they are defaults.

◆ setSaveHistory()

void isys::CTestProfiler::setSaveHistory ( iconnect::ETristate  isSave)

Sets the save mode for output file.

If true, history will also be saved.

◆ setTriggerName()

void isys::CTestTrace::setTriggerName ( const std::string &  triggerName)
inherited

Sets name of the trigger to be used for trace start.

The trigger must be defined in winIDEA GUI.