The task viewer resp. "Task Execution Viewer" is part of the development environment IndraWorks and shows a restricted chronological sequence of task processing on the control. The functions of these library part can be used to control and interact with the task viewer functionality in the control.
Task viewer - overview.
- Note
- All recorded tasks must be present at time of call of function mlpiTaskViewerStop otherwise the task viewer functionality is not able to determine the name and the priority of a missing task.
-
The task viewer functionality is not able to recognize any changes of priority of a task. The task viewer functionality determine the priority of a task once at call of function mlpiTaskViewerStop. For deeply debug inspection please use the "System Viewer" of your WindRiver Workbench OEM.
This function starts a task viewer session, all task information is stored in a ring buffer as long as the recording is running. You have to use IndraWorks to upload and view the session in a graphical window. Please have a look within the IndraWorks help system to find more information about the task viewer.
- Parameters
-
[in] | connection | Handle for multiple connections. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // start task viewer session
2 MLPIRESULT result = mlpiTaskViewerStart(connection);
3 if (MLPI_FAILED(result)) {
4 printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
8 // run task viewer for some time
11 // stop task viewer session
12 result = mlpiTaskViewerStop(connection);
13 if (MLPI_FAILED(result)) {
14 printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
18 // now use IndraWorks for visualization of session data...
This function stops a task viewer session.
- Parameters
-
[in] | connection | Handle for multiple connections. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
- See mlpiTaskViewerStart
This function adds a user event into the task viewer session. Use this function to mark special events in the task viewer. This function is very useful for debugging timing problems.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | data | Some user data that will be shown in the task viewer together with this event. |
[in] | numElements | Number of bytes given by data. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example
1 // Add item to task viewer and attach some user data. Task viewer has to be started for this
2 // example to work. After stopping, you should find the item visualized in the task viewer.
3 UCHAR data[] = {0xDE, 0xAD, 0xBE, 0xAF};
4 MLPIRESULT result = mlpiTaskViewerAddItem(connection, data, sizeof(data));
5 if (MLPI_FAILED(result)) {
6 printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result);
This function sets a START event into a task viewer session.
- Note
- For a valid task viewer session, the START event and the STOP event must be set in an alternating manner.
- Parameters
-
[in] | connection | Handle for multiple connections. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
- Create a background task and run it endlessly. In the background task, check every 20 milliseconds the displayed diagnosis. Visualize the needed runtime of the background task in the task viewer.
3 taskSpawn("BackgroundDiagnosis", 200, VX_FP_TASK, 0x200000, (FUNCPTR)&taskBackgroundDiagnosis, connection, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1 extern "C" int taskBackgroundDiagnosis(MLPIHANDLE connection)
3 MLPIRESULT result = MLPI_S_OK;
4 MlpiDiagnosis diagnosis;
5 memset(&diagnosis, 0, sizeof(diagnosis));
8 // set STOP event into task viewer session
9 mlpiTaskViewerTaskStop(connection);
14 // set START event into task viewer session
15 mlpiTaskViewerTaskStart(connection);
17 // Get displayed diagnosis
18 result = mlpiSystemGetDisplayedDiagnosis(connection, &diagnosis);
19 if(MLPI_SUCCEEDED(result)) {
20 // do something with diagnosis
Task viewer session.
This function sets a STOP event into a task viewer session.
- Note
- For a valid task viewer session the START event and the STOP event must be set alternating.
- Parameters
-
[in] | connection | Handle for multiple connections. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
- See mlpiTaskViewerTaskStart
This function gets the current state if the task viewer.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | state | State of the task viewer. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
- MlpiTaskViewerState state; MLPIRESULT result = mlpiTaskViewerGetState(_hControl, &state); if (MLPI_FAILED(result)) { printf("\ncall of MLPI function failed with 0x%08x!", (unsigned)result); return result; }