Subsystem Class

This class provides configuration and control operations for the wRTOS monitoring framework. It is important to understand the distinction between the Persistent Event Set and the Transitent Event Set. This class allows clients to configure two sets of enabled/disabled monitoring events:

Copy
-- The Persistent Event Set
-- The Transient Event Set

 

The Persistent Event Set is the set of enabled/disabled monitoring events persisted in the Registry. This set is configured using wRTOS Settings. Each time the wRTOS Subsystem starts, the Persistent Event Set becomes the set of enabled monitoring events. The Transient Event Set only exists when monitoring is enabled. When the Transient Event Set exists, it controls which monitoring events are enabled/disabled. At the time monitoring is enabled, the Transient Event Set is initialized from the Persistent Event Set. The Transient Event Set is modified using wRTOS Monitor. Changes to the Transient Event Set do not affect the Persistent Event Set. When monitoring is disabled, the Transient Event Set is destroyed. The following APIs in this class provide a bool parameter to control whether the API operates on the Transient Event Set or the Persistent Event Set:

Copy
MF_EVENT_KIND[] GetMonitorEvents(bool persistant)
MF_EVENT_KIND[] DisableMonitorEvents(MF_EVENT_KIND monitorEvent, bool persistent)
MF_EVENT_KIND[] DisableMonitorEvents(bool persistent)
MF_EVENT_KIND[] DisableMonitorEvents(MF_EVENT_KIND[] monitorEventList, bool persistent)
MF_EVENT_KIND[] EnableMonitorEvents(MF_EVENT_KIND monitorEvent, bool persistent)
MF_EVENT_KIND[] EnableMonitorEvents(bool persistent)
MF_EVENT_KIND[] EnableMonitorEvents(MF_EVENT_KIND[] monitorEventList, bool persistent)

 

If the bool parameter in each of the above APIs is set to true, the API operates on the Persistent Event Set, otherwise the API operates on the Transient Event Set. If monitoring is not enabled (i.e., the Transient Event Set does not exist) and these APIs are commanded to operate on the Transient Event Set, these APIs throw an exception.

Inheritance Hierarchy

System.Object
  IntervalZero.MaxRT.wRTOS.wRTOSObject
    IntervalZero.MaxRT.wRTOS.Monitor.Subsystem

Namespace:  IntervalZero.MaxRT.wRTOS.Monitor
Assembly:  IntervalZero.MaxRT.wRTOS (in IntervalZero.MaxRT.wRTOS.dll) Version: 1.0.0.0 (File version: 1.0.1)

Syntax

Copy
public class Subsystem : wRTOSObject, IMonitorSubsystem

 

The Subsystem class exposes the following members.

Constructors

 

Name Description

Public method

Subsystem

Initializes a new instance of the Subsystem class.

Properties

  Name Description

Public property

AutoEnable

If this property is true, the monitoring framework will automatically be enabled when the subysstem starts. Monitoring must be enabled before it can be started.

Public property

AutoRotateLogFiles

If this property is set to false, when the size of the current session folder reaches the size limit specified by property LogSizeMax, the monitoring framework will stop writing monitoring event data to the current monitoring session. If this is set to true, when the size of the current session folder reaches the size limit specified by property LogSizeMax, the monitoring framework will rotate log files within the session folder, deleting the oldest file.

Public property

AutoStart

If this property is true and property AutoEnable is also set to true, the monitoring framework will automatically be started when the Subsystem starts. Monitoring must be enabled before it can be started.

Protected property

IsDisposed

True if the object has been disposed, false otherwise.

(Inherited from wRTOSObject.)

Public property

LogFolder

This property specifies the folder under which monitoring session folders are created. If this property is set, it must specify an existing folder. If the wRTOS Runtime is not installed, this property returns %PUBLIC%\Documents, where %PUBLIC% is expanded to the value of environment variable PUBLIC.

Public property

LogSizeMax

This is the size limit (in MB) for how much disk space a single monitoring session folder can occupy. If this property is set to 0, monitoring events are not written to disk. If this property is changed, the Subsystem must be restarted for the change to take effect.

Public property

MaximumFolderSize

This is the size limit, in megabytes, for all session folders under folder %SYSTEMDRIVE%\Users\Public\Documents\IntervalZero\Monitor. If this property is changed, the Subsystem must be restarted for the change to take effect.

Public property

MTBSize

This property specifies the the size (in megabytes) of the internal buffer used to transport monitoring events from real-time cores to Windows cores. If this property is changed, the Subsystem must be restarted for the change to take effect. If you encounter Data Lost events, you may want to increase the size of this buffer. This property cannnot be set to a value that is greater than three-quarters of the amount of RAM.

Public property

State

Returns the current state of the monitoring framework.

Methods

  Name Description

Public method

DeleteAllSessions

This method deletes all monitoring sessions. This should only be used when the monitoring framework is not enabled.

Public method

DeleteSession

Deletes the specified monitoring session folder and all the files and folders it contains.

Public method

Disable

Disables the monitoring framework.

Public method

DisableMonitorEvents (Boolean)

Disables all events, either in the Persistent Event Set or the Transitent Event Set (depending on the value of parameter persistent). If set to true, the events will be disabled in the Persistent Event Set, and the change will not take affect until monitoring is next enabled, otherwise the events will be disabled in the Transient Event Set.

Return Value

Type: 
An array specifying the current set of disabled events (either persistent or transient, depending on the value of parameter persistent).

Public method

DisableMonitorEvents (MF_EVENT_KIND, Boolean)

This method disables the event specified by parameter monitorEvent, either in the Persistent Event Set or the Transitent Event Set (depending on the value of parameter persistent).

Public method

DisableMonitorEvents (MF_EVENT_KIND, Boolean)

Disables the specified monitoring events, either in the Persistent Event Set or the Transient Event Set, depending on the value of parameter persistent.

Public method

Dispose

Dispose method.

(Inherited from wRTOSObject.)

Public method

Enable

Enables the monitoring framework. Monitoring must be enabled before it can be started.

Public method

EnableMonitorEvents (Boolean)

Enables all events, either in the Persistent Event Set or the Transitent Event Set (depending on the value of parameter persistent). If set to true, the events will be enabled in the Persistent Event Set, and the change will not take affect until monitoring is next enabled, otherwise the events will be enabled in the Transient Event Set.

Return Value

Type: 
An array specifying the current set of enabled events (either persistent or transient, depending on the value of parameter persistent).

Public method

EnableMonitorEvents (MF_EVENT_KIND, Boolean)

This method enables the event specified by parameter monitorEvent, either in the Persistent Event Set or the Transitent Event Set (depending on the value of parameter persistent).

Public method

EnableMonitorEvents (MF_EVENT_KIND, Boolean)

Enables the specified monitoring events, either in the Persistent Event Set or the Transient Event Set, depending on the value of parameter persistent.

Protected method

Finalize

Finalizer.

(Inherited from wRTOSObject.)

Public method

GetMaxEventsInSession

Retrieves the persistent or transient value of the number of events to save in a monitor session.

Public method

GetMonitorEvents

Returns an array specifying which monitoring events are currently enabled. This array contains zero elements if no events are enabled.

Public method

GetPreTriggerEventsToSave

Retrieves the persistent or transient value of the number of pre-start-trigger events to save in a monitor session. Pre-start-trigger events are events that occur before the event that triggers the start of a monitoring session.

Public method

GetTriggers

This method returns the currently configured triggers for all kinds of events. Each element of the returned array corresponds to one enumerator in enumeration MF_EVENT_KIND. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Public method

GetTriggersForCustomEvents

This method returns an array containing the triggers for the first 100 custom event kind values (0 to 99) for event kind MF_EVENT_KIND_CUSTOM. The returned array is exactly 100 elements long. If the Subsystem is not started, this method throws an exception of type wRTOSException. This method can be called when monitoring is stopped or started. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Protected method

OnNotifyPropertyChanged

Called when a property is changed

(Inherited from wRTOSObject.)

Public method

Pause

This method pauses the current monitoring session. When in a Paused state, events are not collected. Use Resume to resume a monitoring session that has been paused.

Public method

ResetAllMonitorProperties

Resets all monitoring-related configuration properties to their default values.

Public method

ResetAllTriggers

This method resets all triggers for all kinds of events. If the Subsystem is not started, this method throws an exception of type Exception containing an explanatory error message. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already reset, they remain reset. Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Public method

ResetAutoEnable

Resets property [!:AutoEnabled] to its default value (false).

Public method

ResetAutoRotateLogFiles

Resets property AutoRotateLogFiles to its default value (true).

Public method

ResetAutoStart

Resets property AutoStart to it's default value (false).

Public method

ResetEnabledComponents

This method resets the monitor event generation enabled status for all product components to the default setting. By default, all product components have monitor event generation enabled. This affects the persistent configuration only, not the transient configuration.

Public method

ResetEvents

Resets the Persistent Event Set to the default combination of enabled/disabled events (see Subsystem for details about the Persistent and Transient Event Sets). This change will take effect the next time monitoring is enabled.

Public method

ResetLogFolder

Resets property LogFolder to its default value (%PROGRAMDATA%\IntervalZero\Monitor).

Public method

ResetLogSizeMax

Resets property LogSizeMax to it default value (200 MB).

Public method

ResetMaxEventsInSession

Resets the persistent value of the number of events to save in a monitor session.

Public method

ResetMaximumFolderSize

Resets property MaximumFolderSize to its default value.

Public method

ResetMTBSize

Resets property MTBSize to its default value (200 MB).

Public method

ResetPreTriggerEventsToSave

Resets the persistent value of the number of pre-start-trigger events to save in a monitor session.

Public method

ResetTrigger (Subsystem.TriggerKinds)

This method resets the specified triggers so that they do not happen for certain kinds of events. Each element of array triggers specifies the triggers to reset for the kind of event specified by the enumerator in enumeration Monitor.MF_EVENT_KIND that corresponds to the index in the array. Array triggers must contain exacly MF_EVENT_KIND.MF_EVENT_KIND_MAX elements, otherwise an exception of type wRTOSExcpetion is thrown. The triggers that are reset correspond to the bits that are set in each element of this array. If the Subsystem is not started, this method throws an exception of type Exception containing an explanatory error message. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already reset, they remain reset. Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Public method

ResetTriggers (MF_EVENT_KIND, Subsystem.TriggerKinds)

This method resets the specified triggers so that they do not happen for the specified kind of event (eventKind). Parameter triggers contains one or more of the flag enumerators from enumeration TriggerKinds specifying the triggers to be reset for this kind of event. If the Subsystem is not started, this method throws an exception of type Exception containing an explanatory error message. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already reset, they remain reset. Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Public method

ResetTriggersForCustomEvents

This method resets triggers for custom event kinds for event kind MF_EVENT_KIND_CUSTOM. Parameter customEventKindTriggers specifies the triggers to reset for the first 100 custom event kind values (0 to 99). This array must be exactly 100 elements long, otherwise an exception of type wRTOSException is thrown. If the Subsystem is not started, this method throws an exception of type Exception. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already reset, they remain reset. Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods.

Public method

Resume

This method resumes the monitoring framework from a Paused state. When a monitoring session is resumed, it continues recording events in the current session. It does not create a new session in which to record events.

Public method

SetMaxEventsInSession

Sets the transient value of the number of events to save in a monitor session.

Public method

SetPreTriggerEventsToSave

Sets the transient value of the number of pre-start-trigger events to save in a monitor session. Pre-start-trigger events are events that occur before the event that triggers the start of a monitoring session.

Public method

SetTriggers(Subsystem.TriggerKinds)

This method sets the specified triggers to happen when certain kinds of events are generated. Each element of array triggers specifies the triggers to set for the kind of event specified by the enumerator in enumeration Monitor.MF_EVENT_KIND that corresponds to the index in the array. Array triggers must contain exacly MF_EVENT_KIND.MF_EVENT_KIND_MAX elements, otherwise an exception of type wRTOSException is thrown. The triggers to be set correspond to the bits that are set in each element of this array. If the Subsystem is not started, this throws method an exception of type Exception containing an explanatory error message. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already set, they remain set. These flag enumerators can be mixed with each other using bitwise operators. The following kinds of monitoring events cannot have triggers set on them. Attempting to do so will cause an exception of type Exception to be thrown:

  • MF_EVENT_KIND_RESERVED (Reserved)
  • MF_EVENT_KIND_MARKER (Marker)
  • MF_EVENT_KIND_SUBSYSTEM_STOP (Subsystem Stop)
  • MF_EVENT_KIND_FAST_SEMAPHORE_ACQUIRE (Fast Semaphore Acquire)
  • MF_EVENT_KIND_FAST_SEMAPHORE_RELEASE (Fast Semaphore Release)
  • MF_EVENT_KIND_FAST_SEMAPHORE_RELEASE_ALL (Fast Semaphore Release All)
  • MF_EVENT_KIND_WFSOEX_WAIT (RtWaitForSingleObjectEx Wait)
  • MF_EVENT_KIND_WFMOEX_WAIT (RtWaitForMultipleObjectEx Wait)
  • MF_EVENT_KIND_THREAD_SLEEP (Thread Sleep)

Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods. IMPORTANT: This method only accumulates new triggers. It never resets a trigger. Thus, if a given kind of event has trigger X set, and this method is called to set only trigger Y for that kind of event, then that kind of event ends up with both trigger X and Y set.

Public method

SetTriggers(MF_EVENT_KIND, Subsystem.TriggerKinds)

This method sets the specified triggers to happen when the specified kind of event (parameter eventKind) is generated. Parameter triggers contains one or more of the flag enumerators from enumeration TriggerKinds specifying the triggers to be set for this kind of event. If the Subsystem is not started, this method throws an exception of type Exception containing an explanatory error message. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already set, they remain set. These flag enumerators can be mixed with each other using bitwise operators. The following kinds of monitoring events cannot have triggers set on them. Attempting to do so will cause an exception of type Exception to be thrown:

  • MF_EVENT_KIND_RESERVED (Reserved)
  • MF_EVENT_KIND_MARKER (Marker)
  • MF_EVENT_KIND_SUBSYSTEM_STOP (Subsystem Stop)
  • MF_EVENT_KIND_FAST_SEMAPHORE_ACQUIRE (Fast Semaphore Acquire)
  • MF_EVENT_KIND_FAST_SEMAPHORE_RELEASE (Fast Semaphore Release)
  • MF_EVENT_KIND_FAST_SEMAPHORE_RELEASE_ALL (Fast Semaphore Release All)
  • MF_EVENT_KIND_WFSOEX_WAIT (RtWaitForSingleObjectEx Wait)
  • MF_EVENT_KIND_WFMOEX_WAIT (RtWaitForMultipleObjectEx Wait)
  • MF_EVENT_KIND_THREAD_SLEEP (Thread Sleep)

Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods. IMPORTANT: This method only accumulates new triggers. It never resets a trigger. Thus, if a given kind of event has trigger X set, and this method is called to set only trigger Y for that kind of event, then that kind of event ends up with both trigger X and Y set.

Public method

SetTriggersForCustomEvents

This method sets triggers for custom event kinds for event kind MF_EVENT_KIND_CUSTOM. Parameter customEventKindTriggers specifies the triggers to be set for the first 100 custom event kind values (0 to 99). This array must be exactly 1000 elements long, otherwise an exception of type wRTOSException is thrown. If the Subsystem is not started, this method throws an exception of type Exception. This method can be called when monitoring is stopped or started. It takes effect immediately. If any of the specified triggers are already set, they remain set. Triggers do not persist after the wRTOS Subsystem stops. If persistence is desired, it is the client's responsibility to save trigger state before the Subsystem stops and to restore it when the Subsystem starts. This method is thread-safe and executes atomically across all processes with respect to all other trigger-related methods. IMPORTANT: This method only accumulates new triggers. It never resets a trigger. Thus, if a given custom event kind has trigger X set, and this method is called to set only trigger Y for that custom event kind, then that custom event kind ends up with both trigger X and Y set.

Public method

Start

Starts the monitoring framework. Monitoring must be enabled (see method Enable) before it can be started.

Public method

Stop

Stops the monitoring framework.

Events

 

Name Description

Public event

PropertyChanged

Event Fired when a property value is changed

(Inherited from wRTOSObject.)

See Also: