winIDEA SDK
isys::CProfilerExportConfig Class Reference

Description

This class contains configuration for export of profiler measurements.

All setters return reference to this, so we can chain calls to set values, for example:

cfg = CProfilerExportFormat().setFileName('profilerResult.xml')
                             .setTimeScope(CProfilerExportFormat::ETimeAll)
                             .setAreaScope(CProfilerExportFormat::EAreaAll);

#include <CProfilerController2.h>

Inherits std::enable_shared_from_this< CProfilerExportConfig >.

Public Types

enum  EContextScope {
  EContextAll , EContextNeutral ,
  EContextCurrent
}
 This enum defines available context scopes for profiler measurement export. More...
 
enum  EAreaScope { EAreaAll , EAreaFilter }
 This enum defines available area scopes for profiler measurement export. More...
 
enum  ETimeScope { ETimeAll , ETimeBetweenMarkers }
 This enum defines available time scopes format for profiler measurement export. More...
 
enum  EExportPartitionNameMode {
  EPNameAuto , EPNameAlways ,
  EPNameNever , EPNameConfigName
}
 This enum defines when to add download file name to area name in exported files, for example: 'iCounter' vs. More...
 

Public Member Functions

 CProfilerExportConfig ()
 Constructs object with default settings, as described with each method. More...
 
CProfilerExportConfigSPtr setFileName (const std::string &fileName)
 Sets the name of the exported file. More...
 
CProfilerExportConfigSPtr setFormatter (CProfilerFormatBaseSPtr &formatter)
 Sets formatter object, which configures export file format. More...
 
CProfilerExportConfigSPtr setAreaScope (EAreaScope areaScope)
 Sets the area scope (default: EAreaAll). More...
 
CProfilerExportConfigSPtr setExportActiveAreasOnly (bool isExportActiveAreasOnly)
 Sets areas to export. More...
 
CProfilerExportConfigSPtr setAreaExportSections (bool isExportFunctions, bool isExportData, bool isExportAUX)
 If area scope is set to EAreaAll (see method setAreaScope()), then this method defines better granularity, so that some types of areas are not exported. More...
 
CProfilerExportConfigSPtr setAreaExportSections (bool isExportFunctions, bool isExportLines, bool isExportData, bool isExportAUX)
 
CProfilerExportConfigSPtr setTimeScope (ETimeScope timeScope)
 Sets the time scope (default: ETimeAll).
 
CProfilerExportConfigSPtr setFunctionsFilter (const std::string &namesOfFunctions)
 Sets names of functions for which profiler measurements should be exported (default: empty). More...
 
CProfilerExportConfigSPtr setVariablesFilter (const std::string &namesOfVariables)
 Sets names of variables for which profiler measurements should be exported (default: empty). More...
 
CProfilerExportConfigSPtr setAUXFilter (const std::string &namesOfIOPorts)
 Sets names of IO ports for which profiler measurements should be exported (default: empty). More...
 
CProfilerExportConfigSPtr setTimeFilter (int64_t startTime, int64_t endTime)
 Sets time-frame for which profiler measurements should be exported (default: both times are set to 0, but are not used if setTimeScope(ETimeBetweenMarkers) is not called). More...
 
CProfilerExportConfigSPtr setContextFilter (const std::string &contextToExport)
 Sets context for which profiler measurements should be exported (default: empty). More...
 
CProfilerExportConfigSPtr setLaunchViewer (bool isLaunchViewer)
 If set to true, launches the system default viewer for the specified document type after export, for example notepad for text documents (default: false).
 
CProfilerExportConfigSPtr setSaveStatistics (bool isSaveStatistics)
 If set to true, statistics data is exported to file (default: true).
 
CProfilerExportConfigSPtr setSaveInfo (bool isSaveInfo)
 
CProfilerExportConfigSPtr setSaveTimeline (bool isSaveTimeline)
 If set to true, time-line data is exported (default: false). More...
 
CProfilerExportConfigSPtr setContextScope (EContextScope saveContext)
 Sets context to be exported to file (default: EContextNeutral).
 
CProfilerExportConfigSPtr setExportPartitionNameMode (EExportPartitionNameMode exportPartNameMode)
 Sets when download file name should be appended to exported area names.
 
std::string getFileName () const
 Returns profiler file name.
 
EAreaScope getAreaScope () const
 Returns profiler area scope.
 
bool isExportFunctions () const
 Returns export flag for functions area. More...
 
bool isExportLines () const
 
bool isExportData () const
 Returns export flag for data area. More...
 
bool isExportAUX () const
 Returns export flag for AUX area. More...
 
bool isExportActiveAreasOnly () const
 Returns true, if only areas with recorded activity will be exported. More...
 
ETimeScope getTimeScope () const
 Returns profiler time scope.
 
std::string getFunctionsFilter () const
 Returns a list of functions to be exported. More...
 
std::string getVariablesFilter () const
 Returns a list of variables to be exported. More...
 
std::string getAUXFilter () const
 Returns a list of IO ports to be exported. More...
 
int64_t getStartTime () const
 Returns export start time.
 
int64_t getEndTime () const
 Returns export and time.
 
std::string getContextFilter () const
 Returns context filter. More...
 
bool isLaunchViewer () const
 Returns true, if viewer will be launched after export.
 
bool isSaveStatistics () const
 Returns true, if profiler statistics should be exported.
 
bool isSaveTimeline () const
 Returns true, if profiler time-line should be exported.
 
bool isSaveInfo () const
 
EContextScope getContextScope () const
 Returns profiler context to be exported.
 
EExportPartitionNameMode getExportPartitionNameMode () const
 Returns setting, which defines when download file name should be appended to exported area names.
 
CProfilerFormatBaseSPtr getFormatter ()
 Returns formatter object, which configures export file format.
 
std::string getContextScopeAsStr () const
 Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Export.ContextScope'. More...
 
std::string getExportPartitionNameModeAsStr () const
 Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Export.ExportPartitionName'. More...
 
std::string getAreaScopeAsStr () const
 Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Scope.AreaScope'. More...
 
std::string getTimeScopeAsStr () const
 Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Scope.TimeScope'. More...
 
void setOptions (CIDEController &ide, const std::string &docFileName)
 Writes options to winIDEA.
 
std::string toString ()
 Returns contents of this object in human readable form.
 

Member Enumeration Documentation

◆ EAreaScope

This enum defines available area scopes for profiler measurement export.

Enumerator
EAreaAll 

all areas are exported

EAreaFilter 

export only areas specified with calls to setFunctionsFilter(), setVariablesFilter(), and setAUXFilter().

◆ EContextScope

This enum defines available context scopes for profiler measurement export.

Enumerator
EContextAll 

functions are exported for all contexts.

Statistics contains information about time spent in each context (IRQ, task).

EContextNeutral 

functions are exported without context info,

times in statistics are sumed for all contexts

EContextCurrent 

export only context specified with

call setContextFilter().

◆ EExportPartitionNameMode

This enum defines when to add download file name to area name in exported files, for example: 'iCounter' vs.

'iCounter,,sample.elf'.

Enumerator
EPNameAuto 

partition name is appended only if there is more than

one download file (partition) in the project

EPNameAlways 

partition name is appended always

EPNameNever 

partition name is never appended

◆ ETimeScope

This enum defines available time scopes format for profiler measurement export.

Enumerator
ETimeAll 

export recorded samples regardless of timestamp

ETimeBetweenMarkers 

export only samples between times specified with call to setTimeFilter()

Constructor & Destructor Documentation

◆ CProfilerExportConfig()

isys::CProfilerExportConfig::CProfilerExportConfig ( )

Constructs object with default settings, as described with each method.

Python example: profiler_controller.py

Member Function Documentation

◆ getAreaScopeAsStr()

std::string isys::CProfilerExportConfig::getAreaScopeAsStr ( ) const

Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Scope.AreaScope'.

See also
setAreaScope()

◆ getAUXFilter()

std::string isys::CProfilerExportConfig::getAUXFilter ( ) const

Returns a list of IO ports to be exported.

Names of ports are separated by spaces.

◆ getContextFilter()

std::string isys::CProfilerExportConfig::getContextFilter ( ) const

Returns context filter.

See also
setContextFilter(), setContextScope()

◆ getContextScopeAsStr()

std::string isys::CProfilerExportConfig::getContextScopeAsStr ( ) const

Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Export.ContextScope'.

See also
setContextScope()

◆ getExportPartitionNameModeAsStr()

std::string isys::CProfilerExportConfig::getExportPartitionNameModeAsStr ( ) const

Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Export.ExportPartitionName'.

See also
setExportPartitionNameMode()

◆ getFunctionsFilter()

std::string isys::CProfilerExportConfig::getFunctionsFilter ( ) const

Returns a list of functions to be exported.

Function names are separated by spaces.

◆ getTimeScopeAsStr()

std::string isys::CProfilerExportConfig::getTimeScopeAsStr ( ) const

Returns string, which can be used for setting of option '/Document/<file name>/ProfilerExport.Scope.TimeScope'.

See also
setTimeScope()

◆ getVariablesFilter()

std::string isys::CProfilerExportConfig::getVariablesFilter ( ) const

Returns a list of variables to be exported.

Names of variables are separated by spaces.

◆ isExportActiveAreasOnly()

bool isys::CProfilerExportConfig::isExportActiveAreasOnly ( ) const

Returns true, if only areas with recorded activity will be exported.

Returns false, if all configured areas will be exported.

See also
setExportActiveAreasOnly()

◆ isExportAUX()

bool isys::CProfilerExportConfig::isExportAUX ( ) const

Returns export flag for AUX area.

See also
setAreaExportSections()

◆ isExportData()

bool isys::CProfilerExportConfig::isExportData ( ) const

Returns export flag for data area.

See also
setAreaExportSections()

◆ isExportFunctions()

bool isys::CProfilerExportConfig::isExportFunctions ( ) const

Returns export flag for functions area.

See also
setAreaExportSections()

◆ isExportLines()

bool isys::CProfilerExportConfig::isExportLines ( ) const
Deprecated:
since 9.12.36 profiler function lines are no longer supported. Always returns false.

◆ isSaveInfo()

bool isys::CProfilerExportConfig::isSaveInfo ( ) const
Deprecated:
9.17.81, Sept. 2018. Had no effect in the past, so there is no replacement. Always returns true.

◆ setAreaExportSections() [1/2]

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setAreaExportSections ( bool  isExportFunctions,
bool  isExportData,
bool  isExportAUX 
)

If area scope is set to EAreaAll (see method setAreaScope()), then this method defines better granularity, so that some types of areas are not exported.

If this method is not called, all flags are set to true by default.

Parameters
isExportFunctionsif true, function areas are exported.
isExportDataif true, data areas are exported
isExportAUXif true, AUX data is exported

◆ setAreaExportSections() [2/2]

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setAreaExportSections ( bool  isExportFunctions,
bool  isExportLines,
bool  isExportData,
bool  isExportAUX 
)
Deprecated:
since winIDEA 9.12.36 line information is no longer available. If 'isExportLines' is set to true, an exception is thrown. Use overload setAreaExportSections(bool, bool, bool) instead.

◆ setAreaScope()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setAreaScope ( EAreaScope  areaScope)

Sets the area scope (default: EAreaAll).

Python example: profiler_controller.py

◆ setAUXFilter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setAUXFilter ( const std::string &  namesOfIOPorts)

Sets names of IO ports for which profiler measurements should be exported (default: empty).

This setting is used only if ara scope is set to EAreaFilter (see setAreaScope()).

Parameters
namesOfIOPortsnames of IO ports from IO module for which profiler measurements should be exported to file. Names of the ports should be separated by spaces, for example 'port1 port2 port3'

◆ setContextFilter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setContextFilter ( const std::string &  contextToExport)

Sets context for which profiler measurements should be exported (default: empty).

Only one context may be specified at a time.

Parameters
contextToExportname of the context to export, for example 'TSK: InitTask', or 'IRQ: Timer'. Prefix TSK should be used for tasks, IRQ for interrupts.

◆ setExportActiveAreasOnly()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setExportActiveAreasOnly ( bool  isExportActiveAreasOnly)

Sets areas to export.

Parameters
isExportActiveAreasOnlyif true, only areas with recorded activity are exported, otherwise all configured areas are exported.

◆ setFileName()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setFileName ( const std::string &  fileName)

Sets the name of the exported file.

If this method is not called, or fileName is empty string, then the existing export file name in winIDEA is used.

Python example: profiler_controller.py

◆ setFormatter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setFormatter ( CProfilerFormatBaseSPtr formatter)

Sets formatter object, which configures export file format.

If this method is not called, XML formatter with default settings is used. Example:

    formatter = ic.CProfilerXMLExportFormat()
    formatter.setUseIndent(False).setTimelineBinary(False)
    exportCfg.setFormatter(formatter)
See also
CProfilerFormatBase

◆ setFunctionsFilter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setFunctionsFilter ( const std::string &  namesOfFunctions)

Sets names of functions for which profiler measurements should be exported (default: empty).

This setting is used only if ara scope is set to EAreaFilter (see setAreaScope()).

Parameters
namesOfFunctionsnames of functions for which profiler measurements should be exported to file. Functions names should be separated by spaces, for example 'func1 func2 func3'

Python example: profiler_controller.py

◆ setSaveInfo()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setSaveInfo ( bool  isSaveInfo)
Deprecated:
9.17.81, Sept. 2018. Had no effect in the past, so there is no replacement.

◆ setSaveTimeline()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setSaveTimeline ( bool  isSaveTimeline)

If set to true, time-line data is exported (default: false).

Python example: profiler_controller.py

◆ setTimeFilter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setTimeFilter ( int64_t  startTime,
int64_t  endTime 
)

Sets time-frame for which profiler measurements should be exported (default: both times are set to 0, but are not used if setTimeScope(ETimeBetweenMarkers) is not called).


To export measurements before trigger, times must be negative. Trigger has timestamp 0.

Parameters
startTimestart of measurements to export relative to trigger
endTimeend of measurements to export. If greater than the timestamp of the last sample, all samples from startTime to the end are exported.

◆ setVariablesFilter()

CProfilerExportConfigSPtr isys::CProfilerExportConfig::setVariablesFilter ( const std::string &  namesOfVariables)

Sets names of variables for which profiler measurements should be exported (default: empty).

This setting is used only if ara scope is set to EAreaFilter (see setAreaScope()).

Parameters
namesOfVariablesnames of variables for which profiler measurements should be exported to file. Names of variables should be separated by spaces, for example 'var1 var2 var3'