winIDEA SDK
|
Deprecated - Use isys::CProfilerController2 instead.
This class controls winIDEA profiler.
Example:
profiler.startConfiguration(isystem.connect.IConnectProfiler.cfTimeStampTime, "targetInit") profiler.addFunction("Type_Simple") profiler.start()
#include <CProfilerController.h>
Public Types | |
typedef std::vector< CProfilerHistory > | HistoryVector |
List of profiler history records. | |
typedef std::vector< CProfilerStatistic > | StatisticsVector |
List of profiler statistic records. | |
Public Member Functions | |
void | addFunction (const std::string &functionName, bool isIncludeFunctionLines=false) |
Adds function area to the current profiler configuration. More... | |
void | addRegion (const std::string &name, bool isTaskId, bool isSingleData, BYTE byMemArea, DWORD aAddress, DWORD aSize) |
Adds memory region to the current profiler configuration. More... | |
void | addRoutine (const std::string &name, BYTE byMemArea, DWORD aAddress, DWORD aSize, iconnect::AddressVector &exits) |
Adds profiler area as a low level routine. More... | |
void | addVariable (const std::string &variableName, bool isTaskId=false, bool isSingleData=false) |
Adds variable area to the current profiler configuration. More... | |
CProfilerController (std::shared_ptr< ConnectionMgr > connectionMgr) | |
Instantiates object. More... | |
CAreaProperties | getAreaProperties (const std::string &areaName) |
Returns area properties, such as handle and address. More... | |
CAreaProperties | getAreaProperties (DWORD dwResultAreaFlags, ADDRESS aAddress) |
Returns area properties, such as name and handle. More... | |
CAreaProperties | getAreaProperties (DWORD handle) |
Returns area properties, such as name and address. More... | |
CProfilerCapabilities | getCapabilities () |
Returns profiler capabilities. More... | |
void | getHistoryAll (DWORD startIDx, DWORD len, HistoryVector &historyList) |
Retrieves history of invocations for all areas. More... | |
IConnectProfiler2 * | getIConnectProfiler () |
Returns the isystem.connect profiler interface. More... | |
int | getNumAreas () |
Returns the number of result areas. More... | |
void | getStatisticsAll (size_t expectedSize, CProfilerController::StatisticsVector &statisticsList) |
Retrieves statistic results for all areas. More... | |
void | getStatisticsForHandle (DWORD handle, size_t expectedSize, CProfilerController::StatisticsVector &statisticsList) |
Retrieves statistic results for area with the given handle. More... | |
void | getStatisticsForTask (DWORD handle, DWORD taskId, size_t expectedSize, CProfilerController::StatisticsVector &statisticsList) |
Retrieves statistic results for task with the given profiler area handle. More... | |
void | getStatisticsForTask (DWORD taskID, size_t expectedSize, CProfilerController::StatisticsVector &statisticsList) |
Retrieves statistic results for task with the given ID, for all areas. More... | |
void | getStatisticsForValue (DWORD handle, DWORD value, size_t expectedSize, CProfilerController::StatisticsVector &statisticsList) |
Retrieves statistic results for data area with the given handle and value. More... | |
CProfilerStatus | getStatus (::IConnectProfiler::EGetStatusFlags statusFlags=::IConnectProfiler::gsfNumRecorded) |
Polls the profiler status. More... | |
void | start () |
Starts profiler. | |
void | startConfiguration (IConnectProfiler::EConfigFlags startConfigFlags) |
Configures profiler for start without waiting for trigger. More... | |
void | startConfiguration (IConnectProfiler::EConfigFlags startConfigFlags, BYTE memArea, ADDRESS address) |
Configures profiler for start when the instruction on the specified address will be executed. More... | |
void | startConfiguration (IConnectProfiler::EConfigFlags startConfigFlags, const SProfilerStartingPoint &pStartingPoint) |
Sets the given configuration for profiler. More... | |
void | startConfiguration (IConnectProfiler::EConfigFlags startConfigFlags, const std::string &functionName) |
Configures profiler for start when execution of the specified function starts. More... | |
bool | stop () |
Stops profiler. More... | |
bool | waitUntilLoaded (int timeout=0, DWORD pollingInterval=100) |
This method polls profiler status with the given polling interval and returns when profiler stops loading samples from the hardware, or timeout expires. More... | |
isys::CProfilerController::CProfilerController | ( | std::shared_ptr< ConnectionMgr > | connectionMgr | ) |
Instantiates object.
connectionMgr | class which maintains connection to winIDEA. Connection must be established before this call. |
void isys::CProfilerController::addFunction | ( | const std::string & | functionName, |
bool | isIncludeFunctionLines = false |
||
) |
Adds function area to the current profiler configuration.
functionName | name of the function to profile |
isIncludeFunctionLines | if true, profiles also each line of a function, however accuracy of these results may be low on some systems. Results for each line are currently not accessible from isystem.connect interface. |
void isys::CProfilerController::addRegion | ( | const std::string & | name, |
bool | isTaskId, | ||
bool | isSingleData, | ||
BYTE | byMemArea, | ||
DWORD | aAddress, | ||
DWORD | aSize | ||
) |
Adds memory region to the current profiler configuration.
name | area name |
isTaskId | set this to true, if area is task ID |
isSingleData | set this to true, if area is the 'single data' (OTM style) object. |
byMemArea | memory area of the start address |
aAddress | start address of the area |
aSize | size of the area |
void isys::CProfilerController::addRoutine | ( | const std::string & | name, |
BYTE | byMemArea, | ||
DWORD | aAddress, | ||
DWORD | aSize, | ||
iconnect::AddressVector & | exits | ||
) |
Adds profiler area as a low level routine.
name | area name |
byMemArea | memory area of the start address |
aAddress | start address of the area |
aSize | size of the area |
exits | points to a vector of ADDRESS_64 type objects, each specifying an exit point from afTypeRoutine object |
void isys::CProfilerController::addVariable | ( | const std::string & | variableName, |
bool | isTaskId = false , |
||
bool | isSingleData = false |
||
) |
Adds variable area to the current profiler configuration.
variableName | name of the variable to profile |
isTaskId | set this to true, if variable is task ID |
isSingleData | set this to true, if variable is the 'single data' (OTM style) object. |
CAreaProperties isys::CProfilerController::getAreaProperties | ( | const std::string & | areaName | ) |
Returns area properties, such as handle and address.
areaName | name of the area, which properties should be returned |
CAreaProperties isys::CProfilerController::getAreaProperties | ( | DWORD | dwResultAreaFlags, |
ADDRESS | aAddress | ||
) |
Returns area properties, such as name and handle.
dwResultAreaFlags | should be IConnectProfiler2::grafTypeExec or IConnectProfiler2::grafTypeData, depending on address type |
aAddress | address of the area, which properties should be returned |
CAreaProperties isys::CProfilerController::getAreaProperties | ( | DWORD | handle | ) |
Returns area properties, such as name and address.
handle | handle of the area, which properties should be returned |
CProfilerCapabilities isys::CProfilerController::getCapabilities | ( | ) |
Returns profiler capabilities.
IOException | in case of an error |
void isys::CProfilerController::getHistoryAll | ( | DWORD | startIDx, |
DWORD | len, | ||
HistoryVector & | historyList | ||
) |
Retrieves history of invocations for all areas.
startIDx | start index of array of data to retrieve |
len | number of history items to retrieve |
historyList | vector to contain data on return |
IConnectProfiler2 * isys::CProfilerController::getIConnectProfiler | ( | ) |
Returns the isystem.connect profiler interface.
Use this method only when some functionality of the IConnectProfiler2 interface is not accessible from this wrapper.
int isys::CProfilerController::getNumAreas | ( | ) |
Returns the number of result areas.
Area handles have values in the range [0, numAreas - 1], so we can easily iterate all areas.
void isys::CProfilerController::getStatisticsAll | ( | size_t | expectedSize, |
CProfilerController::StatisticsVector & | statisticsList | ||
) |
Retrieves statistic results for all areas.
If output vector size equals expectedSize, it means that there is more data to retrieve. Increase expected size and call this method again to get all data.
expectedSize | expected number of statistics items to be returned. If it is to small only the specified number of items will be returned. If it is to big, to much memory is allocated for local buffer. |
statisticsList | the vector, which will contain results on return |
void isys::CProfilerController::getStatisticsForHandle | ( | DWORD | handle, |
size_t | expectedSize, | ||
CProfilerController::StatisticsVector & | statisticsList | ||
) |
Retrieves statistic results for area with the given handle.
If output vector size equals expectedSize, it means that there is more data to retrieve. Increase expected size and call this method again to get all data.
handle | profiler area handle |
expectedSize | expected number of statistics items to be returned. If it is to small only the specified number of items will be returned. If it is to big, to much memory is allocated for local buffer. |
statisticsList | the vector, which will contain results on return |
void isys::CProfilerController::getStatisticsForTask | ( | DWORD | handle, |
DWORD | taskId, | ||
size_t | expectedSize, | ||
CProfilerController::StatisticsVector & | statisticsList | ||
) |
Retrieves statistic results for task with the given profiler area handle.
If output vector size equals expectedSize, it means that there is more data to retrieve. Increase expected size and call this method again to get all data.
handle | profiler area handle |
taskId | ID of the task |
expectedSize | expected number of statistics items to be returned. If it is to small only the specified number of items will be returned. If it is to big, to much memory is allocated for local buffer. |
statisticsList | the vector, which will contain results on return |
void isys::CProfilerController::getStatisticsForTask | ( | DWORD | taskID, |
size_t | expectedSize, | ||
CProfilerController::StatisticsVector & | statisticsList | ||
) |
Retrieves statistic results for task with the given ID, for all areas.
If output vector size equals expectedSize, it means that there is more data to retrieve. Increase expected size and call this method again to get all data.
taskID | ID of the task |
expectedSize | expected number of statistics items to be returned. If it is to small only the specified number of items will be returned. If it is to big, to much memory is allocated for local buffer. |
statisticsList | the vector, which will contain results on return |
void isys::CProfilerController::getStatisticsForValue | ( | DWORD | handle, |
DWORD | value, | ||
size_t | expectedSize, | ||
CProfilerController::StatisticsVector & | statisticsList | ||
) |
Retrieves statistic results for data area with the given handle and value.
If output vector size equals expectedSize, it means that there is more data to retrieve. Increase expected size and call this method again to get all data.
handle | profiler area handle |
value | value of the task |
expectedSize | expected number of statistics items to be returned. If it is to small only the specified number of items will be returned. If it is to big, to much memory is allocated for local buffer. |
statisticsList | the vector, which will contain results on return |
CProfilerStatus isys::CProfilerController::getStatus | ( | ::IConnectProfiler::EGetStatusFlags | statusFlags = ::IConnectProfiler::gsfNumRecorded | ) |
Polls the profiler status.
statusFlags | define the type of information returned in CProfilerStatus. See IConnectProfiler::EGetStatusFlags. |
void isys::CProfilerController::startConfiguration | ( | IConnectProfiler::EConfigFlags | startConfigFlags | ) |
Configures profiler for start without waiting for trigger.
startConfigFlags | define profiler resolution |
void isys::CProfilerController::startConfiguration | ( | IConnectProfiler::EConfigFlags | startConfigFlags, |
BYTE | memArea, | ||
ADDRESS | address | ||
) |
Configures profiler for start when the instruction on the specified address will be executed.
startConfigFlags | define profiler resolution |
memArea | memory area of the profiler start address |
address | profiler start address |
void isys::CProfilerController::startConfiguration | ( | IConnectProfiler::EConfigFlags | startConfigFlags, |
const SProfilerStartingPoint & | pStartingPoint | ||
) |
Sets the given configuration for profiler.
Use this method only if other overloaded variants do not support some settings in configuration.
startConfigFlags | define profiler resolution |
pStartingPoint | the starting point |
void isys::CProfilerController::startConfiguration | ( | IConnectProfiler::EConfigFlags | startConfigFlags, |
const std::string & | functionName | ||
) |
Configures profiler for start when execution of the specified function starts.
startConfigFlags | define profiler resolution |
functionName | name of the profiler trigger function |
bool isys::CProfilerController::stop | ( | ) |
Stops profiler.
bool isys::CProfilerController::waitUntilLoaded | ( | int | timeout = 0 , |
DWORD | pollingInterval = 100 |
||
) |
This method polls profiler status with the given polling interval and returns when profiler stops loading samples from the hardware, or timeout expires.
timeout | timeout in milliseconds. 0 means infinite timeout |
pollingInterval | time between two readings of the profiler status |