RtMonitorChangeState

RtMonitorChangeState transitions the status of monitoring.

Note: The Subsystem must be started and Monitoring must be enabled in order for this function to work.

Syntax

Copy
BOOL RtMonitorChangeState(
    [in]    WRTOS_MONITOR_CONTROL_OP monitorState,
);

Parameters

[in] monitorState

One of the following enumerators from enumeration WRTOS_MONITOR_CONTROL_OP:

Constant Meaning

MONITOR_CONTROL_START

Start a monitoring session.

MONITOR_CONTROL_PAUSE

Pause the collection of monitoring events during the current session without having to create a new session file.

MONITOR_CONTROL_RESUME

Resume the monitoring session from a paused state.

MONITOR_CONTROL_STOP

Stop the current monitoring session.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE and sets the last error value.

Possible error codes:

Error code Meaning

ERROR_INVALID_PARAMETER

A value other than one of the monitoring states in WRTOS_MONITOR_CONTROL_OP has been specified.

RT_ERROR_MONITORING_ENABLED

An operation attempted to enable monitoring, but monitoring was already enabled.

RT_ERROR_MONITORING_DISABLED

Monitoring was disabled when an operation was attempted that required it to be enabled.

RT_ERROR_MONITORING_STARTED

Monitoring was started when an operation was attempted that required it to be stopped.

RT_ERROR_MONITORING_STOPPED

Monitoring was stopped when an operation was attempted that required it to be started.

RT_ERROR_MONITORING_PAUSED

Monitoring was paused when an operation was attempted that required it to be running.

Remarks

Enabling monitoring with this API causes CPU and disk I/O overhead. You can eliminate this overhead by programmatically stopping or disabling monitoring with this API or with RtMonitorControl.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtApi.h

RtApi.lib (Windows), Startup.lib (RTSS)

See Also: