winIDEA SDK
isys::CProfilerController2 Class Reference

Description

This class implements profiler functionality with a document oriented interface.

It replaces the old CProfilerController, which is deprecated now. If you need some functionality from the old class, which is missing in this one, please contact iSYSTEM support, rather than using the old class. If you use the old class, your code will no longer work once the deprecated class will be removed in the future versions of isystem.connect.

Portability list

CProfilerController()  -->  CProfilerController2() 
                            File name and open mode are required.

getCapabilities()      -->  not implemented in CProfilerController2

startConfiguration()   -->  use setFunctionTrigger()

All get...() methods are implemented in isys::CProfilerData2 class.

This class can be used to configure profiler, run recording, and export the recorded data. However, it has no methods to get recorded information. For this purpose a separate class called CProfilerData2 should be used.

Use only methods documented for this class. If a method from the base class is not documented here, do not use it.

Advanced profiler configuration

Most settings for profiler are implemented by setting of winIDEA options. Since there are many options, and most of them are target dependent, this class provides methods for accessing only the most often used options. To see all profiler options, open profiler document in winIDEA, then select Help | Display Option.... In the opened dialog select all check-boxes, and radio button 'Document'. Then select profiler document in the combo box next to the radio button. Click the Display' button to see all profiler options as shown in the image below:

#include <CProfilerController2.h>

Inheritance diagram for isys::CProfilerController2:
isys::CAnalyzerDocController isys::CDocumentController isys::WrapperBase

Public Types

enum  EDataAreaType { EDATState , EDATLsbExitEntry , EDATZeroExitEntry , EDATRegular }
 Enumeration of data area types. More...
 
enum  EStateVarDefinition {
  EStateDefNone , EStateDefDefine ,
  EStateDefEnum
}
 Defines which C language construct is used for definition of variable's states. More...
 
enum  ETraceMessageType { ESingleData , ESingleData1 }
 Defines which trace messages should be recorded. More...
 
enum  EDocumentType {
  ANALYZER , CODE_COVERAGE ,
  PROFILER
}
 new enum type introduced, to limit the allowed values More...
 
enum  EAnalysisType {
  ETraceOnly , ECoverage ,
  EProfiler , EBoth
}
 Which type of analysis should be performed on recording. More...
 

Public Member Functions

 CProfilerController2 (std::shared_ptr< ConnectionMgr > connectionMgr, const std::string &fileName, const std::string &mode)
 Instantiates object and opens or creates profiler document in winIDEA. More...
 
int createTrigger (const std::string &triggerName)
 Creates a new profiler trigger. More...
 
void setProfilingSections (int triggerIndex, bool isProfileCode, bool isProfileData, bool isProfileOSObjects, bool isProfileAUX)
 Defines, which sections (code, data, AUX) should be recorded by profiler. More...
 
void setFunctionTrigger (int triggerIndex, const std::string &functionName)
 Sets a function, which will start profiling, when its execution starts. More...
 
int addFunction (int triggerIndex, const std::string &functionName, bool isIncludeFunctionLines=false)
 Adds function to the list of functions to profile. More...
 
void addFunctions (int triggerIndex, const iconnect::StrVector &functions)
 Adds functions to the list of functions to profile. More...
 
int addVariable (int triggerIndex, const std::string &variableName, EDataAreaType dataAreaType)
 Adds variable to the list of variables to profile. More...
 
int addTraceMessage (int triggerIndex, const std::string &traceMessage, EDataAreaType dataAreaType, ETraceMessageType messageType)
 Adds trace message to the list of variables to profile. More...
 
int addStateVariable (int triggerIndex, const std::string &variableName, EStateVarDefinition stateVarDef, const std::string definitionName)
 Adds state variable to the list of variables to profile. More...
 
int addAuxVariable (int triggerIndex, const std::string &variableName, EDataAreaType dataAreaType)
 Adds AUX input to the list of variables to profile. More...
 
int removeFunction (int triggerIndex, const std::string &functionName)
 Removes function from the list of functions to profile. More...
 
int removeVariable (int triggerIndex, const std::string &variableName)
 Removes variable from the list of variables to profile. More...
 
void removeAllFunctions (int triggerIndex)
 Removes all functions from the list of functions to profile. More...
 
void removeAllVariables (int triggerIndex)
 Removes all variables from the list of variables to profile. More...
 
int getSessionDuration (int triggerIndex)
 Returns how long should profiler recording last on next run. More...
 
void setSessionDuration (int triggerIndex, int sessionDurationInMilliseconds)
 Sets how long should profiler recording last on next run. More...
 
void exportData (isys::CProfilerExportConfigSPtr exportConfig)
 Exports profiler data according to the given configuration. More...
 
std::string dataAreaType2Str (EDataAreaType dataAreaType)
 Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].Type. More...
 
std::string stateVarDef2Str (CProfilerController2::EStateVarDefinition stateVarDef)
 Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].Definition. More...
 
std::string traceMsgDef2Str (CProfilerController2::ETraceMessageType traceMsgType)
 Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].DataType. More...
 
bool isActive ()
 Returns true if the document start action is still running, false otherwise. More...
 
bool isBusy ()
 Returns true if the document is still changing, either because recording or loading/analysis is still running. More...
 
void setDirty (bool isDirty)
 Sets dirty status of the document. More...
 
void abort ()
 Aborts loading of document contents from a file. More...
 
void stopSampling ()
 Stops sampling (recording) operation. More...
 
void stopUploading ()
 Stops transfer of data to PC. More...
 
void stopAnalyzing ()
 Stops analysis of analyzer data. More...
 
void stopLoadingOrSaving ()
 Stops load or save operation.
 
CAnalyzerSessionStatus getAnalyzerSessionStatus ()
 Returns analyzer session status. More...
 
CDocumentStatus getDocumentStatus ()
 Returns analyzer document status.
 
int getActiveTriggerIndex ()
 Returns index of the currently active trigger. More...
 
void setAnalysisType (int triggerIndex, EAnalysisType analysisType)
 This method sets analysis type on the given trigger. More...
 
int removeTrigger (const std::string &triggerName)
 Removes profiler or trace trigger. More...
 
int getTriggerIndex (const std::string &triggerName, bool isThrowException=true)
 Returns the index of the trigger with the given name. More...
 
void select (const std::string &triggerName)
 Selects trigger from 'Analyzer Configuration' toolbar drop down list in winIDEA (the one with a hammer and text) More...
 
void select (int index)
 Selects trigger from 'Analyzer Configuration' toolbar drop down list in winIDEA (the one with a hammer and text) More...
 
bool waitUntilLoaded (int timeoutMs=0, DWORD pollingIntervalMs=100, bool isThrow=false)
 This method polls analyzer status with the given polling interval and returns when analyzer stops loading samples from the hardware, or timeout expires. More...
 
int getNumberOfTriggers ()
 Returns the number of triggers defined in the opened document. More...
 
std::string getDocumentOptionURL (const std::string &postfix)
 This utility method returns URL of analyzer document option. More...
 
std::string getTriggerOption (int index, const std::string &triggerOption)
 Returns value of trigger option, for example trigger name, buffer size, trigger position, ... More...
 
void setTriggerOption (int index, const std::string &triggerOption, const std::string &newValue)
 Sets value of the trigger option, for example trigger name, buffer size, trigger position, ... More...
 
void setTriggerOption (int index, const std::string &triggerOption, DWORD newValue)
 Sets value of the trigger option, for example trigger name, buffer size, trigger position, ... More...
 
void setMarker ()
 Not available for analyzer documents - does nothing.
 
CIDEControllerSPtr getIConnectIDE ()
 Returns the isystem.connect IDE interface. More...
 
void start ()
 Starts default document action. More...
 
void start1 ()
 Starts alternate document action. More...
 
void stop ()
 Stops document action. More...
 
void close ()
 Closes the document. More...
 
void closeDiscard ()
 Closes the document and discards any unsaved changes. More...
 
void closeAll ()
 Closes all documents. More...
 
void reset (IConnectIDE::EDocumentResetParameter resetScope)
 Resets contents of the document. More...
 
void save ()
 Saves the document. More...
 
void saveAs (const std::string &fileName, bool isForceOverwrite=false)
 Saves the document with a new name. More...
 
void saveCopy (const std::string &newFileName)
 Saves copy of the document under a given file name. More...
 
void saveAsPrompt ()
 Saves the document, winIDEA prompts the user for a new name. More...
 

Static Public Attributes

static const std::string exportCCAsHTML
 Export coverage document as HTML file. More...
 
static const std::string exportCCAsText
 Export coverage document as text file. More...
 
static const std::string exportCCAsCSV
 Export coverage document as CSV file. More...
 
static const std::string exportCCAsXML
 Export coverage document as XML file. More...
 
static const std::string exportCCAsXML2
 Export coverage document as XML file. More...
 
static const std::string exportCCAsGCOV
 Export coverage document as GNU coverage file. More...
 
static const std::string exportCCAsReviewHTML
 Export coverage document as HTML file in format suitable for code review. More...
 
static const std::string exportCCAsReviewText
 Export coverage document as text file in format suitable for code review. More...
 
static const std::string exportTrcAsText
 Export trace document as text file. More...
 
static const std::string exportTrcAsCSV
 Export trace document as CSV file. More...
 
static const std::string exportTrcAsBinary
 Export trace document as binary file. More...
 
static const std::string exportTrcAsXML
 Export trace document as XML file. More...
 
static const std::string exportProfilerAsXML
 Export profiler document as XML file. More...
 
static const std::string exportProfilerAsText1
 Export profiler document as customized text file. More...
 
static const std::string exportProfilerAsBTF
 Export profiler document as BTF file. More...
 
static const std::string exportProfilerAsMDF
 Export profiler document as MDF file. More...
 
static const std::string exportProfilerAsHTML
 Export profiler document as HTML file. More...
 

Member Enumeration Documentation

◆ EAnalysisType

Which type of analysis should be performed on recording.

Enumerator
ETraceOnly 

trace is recorded, but no profiler or coverage analysis is performed

ECoverage 

coverage only

EProfiler 

profiler only

EBoth 

profiler and coverage

◆ EDataAreaType

Enumeration of data area types.

Enumerator
EDATState 

Data area is a state variable.

It is supposed to have only few values, at most 256. Task ID or state in state machine are examples of state variables. Statistics will be recoded for each value.

EDATRegular 

Regular variable, can have any number of values, but no statistics will be available for each value.

◆ EDocumentType

new enum type introduced, to limit the allowed values

Enumerator
ANALYZER 

trace document

CODE_COVERAGE 

code coverage document.

For internal use only, instantiate class CCoverageController instead.

PROFILER 

profiler document.

For internal use only, instantiate class CProfilerController2 instead.

◆ EStateVarDefinition

Defines which C language construct is used for definition of variable's states.

This information is then used to assign names to states in profiler export.

Enumerator
EStateDefNone 

no definition, there will be empty name for state variables

EStateDefDefine 

variable state names will be taken from defines

EStateDefEnum 

variable state names will be taken from enum type

◆ ETraceMessageType

Defines which trace messages should be recorded.

It is important to select the right type for your target.

Enumerator
ESingleData 

messages without parameters, for example OTM on PowerPC

ESingleData1 

messages with parameter, for example ITM on ARM, where parameter is channel number.

Constructor & Destructor Documentation

◆ CProfilerController2()

isys::CProfilerController2::CProfilerController2 ( std::shared_ptr< ConnectionMgr connectionMgr,
const std::string &  fileName,
const std::string &  mode 
)

Instantiates object and opens or creates profiler document in winIDEA.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.
fileNameif not an empty string, it is used, otherwise the user is prompted for fileName by winIDEA. In the later case this object can not be used, because the file name is known only in winIDEA.
modedocument open mode. 'u' opens existing file for update (file must exist), 'w' opens existing file and deletes recordings, or creates a new file, 'a' opens existing file and keeps contents, or creates a new file if it does not exist.

Python example: test_create_close_instance.py

Member Function Documentation

◆ abort()

void isys::CAnalyzerDocController::abort ( )
inherited

Aborts loading of document contents from a file.

Use this method only when opening a really large documents and contents is not needed, otherwise call waitUntilLoaded() and wait until document contents is loaded. Has no effect when analyzer is running.

◆ addAuxVariable()

int isys::CProfilerController2::addAuxVariable ( int  triggerIndex,
const std::string &  variableName,
EDataAreaType  dataAreaType 
)

Adds AUX input to the list of variables to profile.

If the input is already in the list, it is not added, only dataAreaType of the existing entry is set.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
variableNamename of the AUX input to profile
dataAreaTypetype of variable, see CProfilerController2::EDataAreaType
Returns
index of DataArea with the added function Python example: test_add_items.py

◆ addFunction()

int isys::CProfilerController2::addFunction ( int  triggerIndex,
const std::string &  functionName,
bool  isIncludeFunctionLines = false 
)

Adds function to the list of functions to profile.

If the function is already in the list, it is not added again.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
functionNamename of the function to profile
isIncludeFunctionLinessince version 9.12.36 this parameter must always be false, because profiling function lines is no longer supported.
Returns
index of profiler option ExecArea, which contains the added function

Python example: test_add_items.py

◆ addFunctions()

void isys::CProfilerController2::addFunctions ( int  triggerIndex,
const iconnect::StrVector functions 
)

Adds functions to the list of functions to profile.

If a function is already in the list, it is not added.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
functionslist of functions to add

◆ addStateVariable()

int isys::CProfilerController2::addStateVariable ( int  triggerIndex,
const std::string &  variableName,
EStateVarDefinition  stateVarDef,
const std::string  definitionName 
)

Adds state variable to the list of variables to profile.

If the variable is already in the list, it is not added, only stateVarDef and definitonName of the existing entry are set. If definitonName is not available, use addVariable(.., EDATState) instead of this function.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
variableNamename of the variable to profile
stateVarDefhow variable states are defined, see CProfilerController2::EStateVarDefinition
definitionNamename of state definition, for example name of enum type
Returns
index of DataArea with the added function

Python example: test_add_items.py

◆ addTraceMessage()

int isys::CProfilerController2::addTraceMessage ( int  triggerIndex,
const std::string &  traceMessage,
EDataAreaType  dataAreaType,
ETraceMessageType  messageType 
)

Adds trace message to the list of variables to profile.

If the message is already in the list, it is not added, only dataAreaType of the existing entry is set.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
traceMessagename of the message to record. For PowerPC this should be empty string, for ARM this should be channel number of ITM messages.
dataAreaTypedefines the way to analyze the recorded data, see CProfilerController2::EDataAreaType
messageTypetype of messages, see CProfilerController2::ETraceMessageType
Returns
index of DataArea with the added function

Python example: test_add_items.py

◆ addVariable()

int isys::CProfilerController2::addVariable ( int  triggerIndex,
const std::string &  variableName,
EDataAreaType  dataAreaType 
)

Adds variable to the list of variables to profile.

If the variable is already in the list, it is not added, only dataAreaType of the existing entry is set. If it is a state variable, and names of states are known, consider using addStateVariable().

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
variableNamename of the variable to profile
dataAreaTypetype of variable, see CProfilerController2::EDataAreaType
Returns
index of DataArea with the added function

Python example: test_add_items.py

◆ close()

void isys::CDocumentController::close ( )
inherited

Closes the document.

If the document is changed but not saved, winIDEA prompts user if he would like to save the file.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ closeAll()

void isys::CDocumentController::closeAll ( )
inherited

Closes all documents.

If there are no documents opened via isystem.connect, CIDEController::closeAllDocuments() can also be used.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ closeDiscard()

void isys::CDocumentController::closeDiscard ( )
inherited

Closes the document and discards any unsaved changes.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_close.py

◆ createTrigger()

int isys::CProfilerController2::createTrigger ( const std::string &  triggerName)

Creates a new profiler trigger.

Trigger contains information about what profiler should record (which functions, variables, ...) and how to record it (when to start, buffer size, ...).

Parameters
triggerNamename of the trigger
Returns
index of the created trigger
Exceptions
IllegalArgumentExceptionif the trigger already exists

Python example: test_profiler_create_trigger.py

◆ dataAreaType2Str()

std::string isys::CProfilerController2::dataAreaType2Str ( EDataAreaType  dataAreaType)

Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].Type.

Python example: test_data_areatype2str.py

◆ exportData()

void isys::CProfilerController2::exportData ( isys::CProfilerExportConfigSPtr  exportConfig)

Exports profiler data according to the given configuration.

Example:

profiler = CProfilerController2(connectionMgr, "profiler.trd", "w");

...

cfg = CProfilerExportConfig().setFileName('profilerResult.xml')
                             .setExportFormat(CProfilerExportFormat::EXML)
                             .setAreaScpe(CProfilerExportConfig::EAll);
profiler.exportData(cfg);

Python example: test_exports.py

◆ getActiveTriggerIndex()

int isys::CAnalyzerDocController::getActiveTriggerIndex ( )
inherited

Returns index of the currently active trigger.

If you want to get the active trigger name, call method:

triggerName = getTriggerOption(index, "Name").
See also
getTriggerOption

◆ getAnalyzerSessionStatus()

CAnalyzerSessionStatus isys::CAnalyzerDocController::getAnalyzerSessionStatus ( )
inherited

Returns analyzer session status.

Use this method to check for analyzer status and recording errors.

◆ getDocumentOptionURL()

std::string isys::CAnalyzerDocController::getDocumentOptionURL ( const std::string &  postfix)
inherited

This utility method returns URL of analyzer document option.

The returned URL is composed as '/Document/' + fileName + '/' + postfix. Use this method when you have to set some option, which is not accessible with methods of this class or derived classes.

Python example: test_set_profiling_sections.py

◆ getIConnectIDE()

CIDEControllerSPtr isys::CDocumentController::getIConnectIDE ( )
inherited

Returns the isystem.connect IDE interface.

Use this method only when some functionality of the IConnectIDE interface regarding workspace handling is not accessible from this wrapper.

◆ getNumberOfTriggers()

int isys::CAnalyzerDocController::getNumberOfTriggers ( )
inherited

Returns the number of triggers defined in the opened document.

Python example: profiler_controller.py

◆ getSessionDuration()

int isys::CProfilerController2::getSessionDuration ( int  triggerIndex)

Returns how long should profiler recording last on next run.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
Returns
session duration in milliseconds if limit is enabled, negative value of session duration if limit is disabled.

Python example: test_get_set_session_duration.py

◆ getTriggerIndex()

int isys::CAnalyzerDocController::getTriggerIndex ( const std::string &  triggerName,
bool  isThrowException = true 
)
inherited

Returns the index of the trigger with the given name.

Parameters
triggerNamename of analyzer trigger as specified in 'Analyzer Configuration' toolbar drop down list in winIDEA analyzer window (the one with a hammer and text). It is also accessible as winIDEA option with URL /Document/<fileName>/Trigger.Items[<index>].Name. where <index> is the value returned by this method.
isThrowExceptionif trigger with the given name is not found, and:
  • this parameter is set to true, then an IllegalArgumentException is thrown.
  • this parameter is set to false, then -1 is returned.

Python example: profiler_controller.py

◆ getTriggerOption()

std::string isys::CAnalyzerDocController::getTriggerOption ( int  index,
const std::string &  triggerOption 
)
inherited

Returns value of trigger option, for example trigger name, buffer size, trigger position, ...

Parameters
triggerOptionpart of the URL, which is following the Items[] part. For example, name of the trigger at index 0 for analyzer file Sample5554_profiler.trd is specified with winIDEA option URL /Document/Sample5554_profiler.trd/Trigger.Items[0].Name. To get it by this method, we define index as 0 and triggerOption as 'Name'.
Another example - to get sampling starting point, we call this method as: getTriggerOption(0, "HW.Recorder.Start");
indextrigger index, see methods getTriggerIndex() and getNumberOfTriggers()

Python example: profiler_controller.py

◆ isActive()

bool isys::CAnalyzerDocController::isActive ( )
inherited

Returns true if the document start action is still running, false otherwise.

When recording stops, this method returns false, even if loading and analysis of data is still in progress.

See also
isBusy
Exceptions
IOExceptionin case of an error.

Python example: test_coverage_get_status.py

◆ isBusy()

bool isys::CAnalyzerDocController::isBusy ( )
inherited

Returns true if the document is still changing, either because recording or loading/analysis is still running.

Returns false otherwise.

See also
isActive
Exceptions
IOExceptionin case of an error.

◆ removeAllFunctions()

void isys::CProfilerController2::removeAllFunctions ( int  triggerIndex)

Removes all functions from the list of functions to profile.

Parameters
triggerIndexindex of trigger, see getTriggerIndex() Python example: test_remove_items.py

◆ removeAllVariables()

void isys::CProfilerController2::removeAllVariables ( int  triggerIndex)

Removes all variables from the list of variables to profile.

Parameters
triggerIndexindex of trigger, see getTriggerIndex() Python example: test_remove_items.py

◆ removeFunction()

int isys::CProfilerController2::removeFunction ( int  triggerIndex,
const std::string &  functionName 
)

Removes function from the list of functions to profile.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
functionNamename of the function to remove
Returns
-1 if no function with the given name was found, 0 if the function was found and removed

Python example: test_remove_items.py

◆ removeTrigger()

int isys::CAnalyzerDocController::removeTrigger ( const std::string &  triggerName)
inherited

Removes profiler or trace trigger.

Parameters
triggerNamename of the trigger to remove
Returns
-1 if trigger with the given name did not exist, otherwise non-negative value is returned

Python example: profiler_controller.py

◆ removeVariable()

int isys::CProfilerController2::removeVariable ( int  triggerIndex,
const std::string &  variableName 
)

Removes variable from the list of variables to profile.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
variableNamename of the variable to remove
Returns
-1 if no variable with the given name was found, 0 if the variable was found and removed

Python example: test_remove_items.py

◆ reset()

void isys::CDocumentController::reset ( IConnectIDE::EDocumentResetParameter  resetScope)
inherited

Resets contents of the document.

Parameters
resetScopedefines which part of the document to reset.

Python example: test_reset.py

◆ save()

void isys::CDocumentController::save ( )
inherited

Saves the document.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveAs()

void isys::CDocumentController::saveAs ( const std::string &  fileName,
bool  isForceOverwrite = false 
)
inherited

Saves the document with a new name.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveAsPrompt()

void isys::CDocumentController::saveAsPrompt ( )
inherited

Saves the document, winIDEA prompts the user for a new name.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ saveCopy()

void isys::CDocumentController::saveCopy ( const std::string &  newFileName)
inherited

Saves copy of the document under a given file name.

The name of the opened document does not change. If the destination file already exists, it is overwritten. Use this method to save intermediate results, for example coverage between several runs.

Exceptions
IOExceptionin case of an error.

Python example: test_save.py

◆ select() [1/2]

void isys::CAnalyzerDocController::select ( const std::string &  triggerName)
inherited

Selects trigger from 'Analyzer Configuration' toolbar drop down list in winIDEA (the one with a hammer and text)

Parameters
triggerNamename of the trigger in the list

Python example: profiler_controller.py

◆ select() [2/2]

void isys::CAnalyzerDocController::select ( int  index)
inherited

Selects trigger from 'Analyzer Configuration' toolbar drop down list in winIDEA (the one with a hammer and text)

Parameters
indexindex of the trigger in the list
See also
getTriggerIndex

Python example: profiler_controller.py

◆ setAnalysisType()

void isys::CAnalyzerDocController::setAnalysisType ( int  triggerIndex,
EAnalysisType  analysisType 
)
inherited

This method sets analysis type on the given trigger.

If trigger is created with CProfilerController2, it is set to profiler only analysis by default. Similar is true for coverage. To perform both types of analysis on the same recording, call this method with analysisType set to EBoth.

◆ setDirty()

void isys::CAnalyzerDocController::setDirty ( bool  isDirty)
inherited

Sets dirty status of the document.

Normally this method is used when dirty flag is not set after configuring the document via API, but we want to save the document.

◆ setFunctionTrigger()

void isys::CProfilerController2::setFunctionTrigger ( int  triggerIndex,
const std::string &  functionName 
)

Sets a function, which will start profiling, when its execution starts.

If trigger is not set, profiling starts immediately when start() is called and target is running.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
functionNamename of the function to use as a profiler trigger. If empty string, trigger start is set to Anything.

Python example: test_set_function_trigger.py

◆ setProfilingSections()

void isys::CProfilerController2::setProfilingSections ( int  triggerIndex,
bool  isProfileCode,
bool  isProfileData,
bool  isProfileOSObjects,
bool  isProfileAUX 
)

Defines, which sections (code, data, AUX) should be recorded by profiler.

Please note, that the meaning of flags is different for each section.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
isProfileCodeif true, code execution is recorded. If function list is empty, (method addFunction() was not called or functions were removed with one of remove() methods), all functions will be recorded. If the function list is not empty, only functions in the list will be recorded. If false, no functions will be recorded.
isProfileDataif true, variables added with addVariable() or addStateVariable() will be recorded. If false, no variables will be recorded.
isProfileOSObjectsif true, OS objects will be recorded. If false OS objects won't be recorded.
isProfileAUXif true, AUX ports will be recorded. If false, AUX ports won't be recorded.

Python example: test_set_profiling_sections.py

◆ setSessionDuration()

void isys::CProfilerController2::setSessionDuration ( int  triggerIndex,
int  sessionDurationInMilliseconds 
)

Sets how long should profiler recording last on next run.

Profiler will stop after the specified number of milliseconds. If target is stopped earlier, profiler session is shorter.

Parameters
triggerIndexindex of trigger, see getTriggerIndex()
sessionDurationInMillisecondsmax duration of next profiler session. If greater than 0, session duration limit is enabled and set to the specified value, otherwise session duration limit is disabled and the time is not changed.

Python example: test_get_set_session_duration.py

◆ setTriggerOption() [1/2]

void isys::CAnalyzerDocController::setTriggerOption ( int  index,
const std::string &  triggerOption,
const std::string &  newValue 
)
inherited

Sets value of the trigger option, for example trigger name, buffer size, trigger position, ...

Parameters
indextrigger index, see methods getTriggerIndex() and getNumberOfTriggers()
triggerOptionpart of the URL, which is following the Items[] part. For example, the name of the trigger at index 0 for analyzer file Sample5554_profiler.trd is specified with winIDEA option URL:

/Document/Sample5554_profiler.trd/Trigger.Items[0].Name

To set the trigger name we call this method as:

setTriggerOption(0, "Name", "myTrig");

Another example - to set sampling starting point, we call this method as:

setTriggerOption(0, "HW.Recorder.Start", "Immediately");
newValuenew value of the config. property, see the Options dialog in winIDEA for the list of options and possible values of each option.

Python example: profiler_controller.py

◆ setTriggerOption() [2/2]

void isys::CAnalyzerDocController::setTriggerOption ( int  index,
const std::string &  triggerOption,
DWORD  newValue 
)
inherited

Sets value of the trigger option, for example trigger name, buffer size, trigger position, ...

Parameters
triggerOptionpart of the URL, which is following the Items[] part. For example, the name of the trigger at index 0 for analyzer file Sample5554_profiler.trd is specified with winIDEA option URL:

/Document/Sample5554_profiler.trd/Trigger.Items[0].Name.

To set the trigger name we call this method as:

setTriggerOption(0, "Name", "myTrig");

Another example - to set sampling starting point, we call this method as:

setTriggerOption(0, "HW.Recorder.Start", "Immediately");
indextrigger index, see methods getTriggerIndex() and getNumberOfTriggers()
newValuenew value of the config. property, see the Options dialog in winIDEA for the list of options and possible values of each option.

◆ start()

void isys::CDocumentController::start ( )
inherited

Starts default document action.

Starts recording if the document type is coverage, profiler or trace, or executes the script if it is a script document. Existing contents of analyzer document is always deleted when this method is called. It is possible to preserve existing coverage information by calling method resume(), instead of this method.

Note: If analyzer is started, then option 'Reactivate session after CPU stop' has no effect. Analyzer will not be automatically started.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ start1()

void isys::CDocumentController::start1 ( )
inherited

Starts alternate document action.

Repeats analysis on a previously recorded data if the document type is analyzer. Usage example: if document is recorded as trace (trace trigger is used), but we want to perform profiler analysis later (with profiler trigger).

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ stateVarDef2Str()

std::string isys::CProfilerController2::stateVarDef2Str ( CProfilerController2::EStateVarDefinition  stateVarDef)

Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].Definition.

Python example: test_state_vardef2str.py

◆ stop()

void isys::CDocumentController::stop ( )
inherited

Stops document action.

For analyzer documents this action is deprecated. Use one of stop...() methods of CAnalyzerController instead.

This method triggers the following state transitions on analyzer document:

  • waiting for trigger: forces trigger, sampling starts
  • sampling: stops sampling, enters loading state and waits until loading is finished
  • loading (data from debugger to PC): waits until loading finishes, does NOT stop it!
  • analyzing: stops analysis. If coverage and profiler analysis are running, call this method twice to stop both.
  • idle: does nothing

For script document this method terminates the script.

Exceptions
IOExceptionin case of an error.

Python example: test_doc_control.py

◆ stopAnalyzing()

void isys::CAnalyzerDocController::stopAnalyzing ( )
inherited

Stops analysis of analyzer data.

To unconditionally stop analyzer immediately, call stopUploading() before this call.

◆ stopSampling()

void isys::CAnalyzerDocController::stopSampling ( )
inherited

Stops sampling (recording) operation.

After this action loading of data starts. Does nothing if sampling has already finished.

Exceptions
IOExceptionin case of an error.

Python example: test_coverage_all_code.py

◆ stopUploading()

void isys::CAnalyzerDocController::stopUploading ( )
inherited

Stops transfer of data to PC.

Continues with analysis of data already transferred to PC. To completely stop analyzer, call stopAnalyzing() after this call.

◆ traceMsgDef2Str()

std::string isys::CProfilerController2::traceMsgDef2Str ( CProfilerController2::ETraceMessageType  traceMsgType)

Returns string, which can be used to set option /Document/<fileName>/Trigger.Items[<idx1>].Profiler.DataArea[<idx2>].DataType.

Python example: test_trace_msgdef2str.py

◆ waitUntilLoaded()

bool isys::CAnalyzerDocController::waitUntilLoaded ( int  timeoutMs = 0,
DWORD  pollingIntervalMs = 100,
bool  isThrow = false 
)
inherited

This method polls analyzer status with the given polling interval and returns when analyzer stops loading samples from the hardware, or timeout expires.

Parameters
timeoutMstimeout in milliseconds. 0 means infinite timeout
pollingIntervalMstime in milliseconds between two readings of the analyzer status
isThrowif true and timeout occurs, an exception is thrown
Returns
true if CPU is in stopped state, false if timeout expired and isThrow == false

Python example: profiler_controller.py

Member Data Documentation

◆ exportCCAsCSV

const std::string isys::CAnalyzerDocController::exportCCAsCSV
staticinherited

Export coverage document as CSV file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsGCOV

const std::string isys::CAnalyzerDocController::exportCCAsGCOV
staticinherited

Export coverage document as GNU coverage file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsHTML

const std::string isys::CAnalyzerDocController::exportCCAsHTML
staticinherited

Export coverage document as HTML file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsReviewHTML

const std::string isys::CAnalyzerDocController::exportCCAsReviewHTML
staticinherited

Export coverage document as HTML file in format suitable for code review.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsReviewText

const std::string isys::CAnalyzerDocController::exportCCAsReviewText
staticinherited

Export coverage document as text file in format suitable for code review.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsText

const std::string isys::CAnalyzerDocController::exportCCAsText
staticinherited

Export coverage document as text file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsXML

const std::string isys::CAnalyzerDocController::exportCCAsXML
staticinherited

Export coverage document as XML file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportCCAsXML2

const std::string isys::CAnalyzerDocController::exportCCAsXML2
staticinherited

Export coverage document as XML file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CCoverageFormatBase instead.

◆ exportProfilerAsBTF

const std::string isys::CAnalyzerDocController::exportProfilerAsBTF
staticinherited

Export profiler document as BTF file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CProfilerFormatBase instead.

◆ exportProfilerAsHTML

const std::string isys::CAnalyzerDocController::exportProfilerAsHTML
staticinherited

Export profiler document as HTML file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CProfilerFormatBase instead.

◆ exportProfilerAsMDF

const std::string isys::CAnalyzerDocController::exportProfilerAsMDF
staticinherited

Export profiler document as MDF file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CProfilerFormatBase instead.

◆ exportProfilerAsText1

const std::string isys::CAnalyzerDocController::exportProfilerAsText1
staticinherited

Export profiler document as customized text file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CProfilerFormatBase instead.

◆ exportProfilerAsXML

const std::string isys::CAnalyzerDocController::exportProfilerAsXML
staticinherited

Export profiler document as XML file.


Can be used to set document option Export.Type, but it is recommended to use classes derived from CProfilerFormatBase instead.

◆ exportTrcAsBinary

const std::string isys::CAnalyzerDocController::exportTrcAsBinary
staticinherited

Export trace document as binary file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CTraceFormatBase instead.

◆ exportTrcAsCSV

const std::string isys::CAnalyzerDocController::exportTrcAsCSV
staticinherited

Export trace document as CSV file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CTraceFormatBase instead.

◆ exportTrcAsText

const std::string isys::CAnalyzerDocController::exportTrcAsText
staticinherited

Export trace document as text file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CTraceFormatBase instead.

◆ exportTrcAsXML

const std::string isys::CAnalyzerDocController::exportTrcAsXML
staticinherited

Export trace document as XML file.

Can be used to set document option Export.Type, but it is recommended to use classes derived from CTraceFormatBase instead.