Get OS Info

This MotoHawk™ block allows a model to read configuration and status information for the target OS.

Block ID

Get OS Info

Library

motohawk_tasking_lib/Metric Blocks

Description

This MotoHawk™ block allows a model to read configuration and status information for the target OS. The information available to MotoHawk™ is dependant upon the Target OS in use, which is set as part of the Target Definition configuration. The block supports a filter that allows only the attributes appropriate for a specific Target OS to be shown in the dropdown. This should help a developer identify what attributes are supported by the selected Target OS.

Typical status type information includes attributes like current percentage of CPU spent idle, or the worstcase stack depth that has been observed for the Operating System's Interrupt Stack or the peak Heap memory consumption. Configuration type attributes include a runtime query of the Interrupt Stack size or margin.

The block will expose the ports necessary to read the selected attribute. The type and dimensions are dependant upon what attribute has been selected.

Block Parameters

Parameter Field Values Comments/Description
Show data selections supported by Dropdown Use this dropdown to filter what attributes shall be exposed for selection. The data selection is filtered based upon the OS selected. Note that the Target OS selected within the Target Definition block does not need to match. However selecting an attribute that is not supported by the Target OS may result in an error or warning depending upon how Unsupported Handling has been configured.

For example, selecting Percent Idle CPU (floating point) because ControlCore is the filter will result in either an error or warning if the Target OS happens to be Classic ControlCore because that attribute is not supported for a task executing within a Classic ControlCore environment.
Data Selection Dropdown Selects the attribute that will be exported by the block. Contents of the drop down is dependant upon the value of the Show data selections supported by filter dropdown. The complete list of attributes is available here.

The dialog will remember what selection has been made for each filter selection. For example, a Percent Idle CPU (floating point) selection made while the ControlCore filter was in use will be remembered if the filter is changed to Classic ControlCore and then later changed back to ControlCore.
Action on Read Dropdown Only visible when the Data Selection supports it. This attribute allows the internal data to be zeroed after it is read by the block or left unchanged.
Unsupported Handling Dropdown Defines how the block should behave when it detects that an attribute has been selected that is not supported under the current operating environment.

For example, selecting the ControlCore attribute Percent Idle CPU (floating point) is problematic if the Target OS happens to be Classic ControlCore because the attribute is not supported in such an operating environment. This attribute defines whether the circumstance represents an error or a warning.

Attributes

Peak Heap Bytes Used

The peak heap consumption depth observed since start-up. The block attribute replaces this block.

Heap Bytes Allocated

The number of bytes allocated to the heap. The reported value will either be the target definition specified value of the ControlCore specified value.

Heap Bytes Margin

The number of bytes allocated to the heap margin. The Application Monitor may use this value or the application may use this value in combination with the allocated and Bytes Used attribute in order to determine if execution is approaching a minimum acceptable margin.

Interrupt Stack Bytes Allocated

The number of bytes allocated to the Interrupt Stack. The reported value will either be the target definition specified value of the ControlCore specified value.

Interrupt Stack Min Bytes Free

During idle execution the tasking kernel will calculate the worst case stack depth that has been observed for the interrupt stack. Given this depth the minimum bytes of free stack remaining can be calculated. Reading this attribute will report the last value that was calculated.

Interrupt Stack Margin

The number of bytes allocated to the interrupt stack margin. The Application Monitor may use this value or the application may use this value in combination with the allocated and Min Bytes Free attribute in order to determine if execution is approaching a minimum acceptable stack margin.

Kernel Stack Min Bytes Free

ControlCore employs a task that will execute when there is truly no other execution to carry out. The developer is not able to influence this stack (which is why there is not a margin or allocation attribute), but the minimum bytes free is made available as a diagnostic.

Percent Idle CPU (fixed point)

The percentage of time that the CPU is considered idle exported as a fixed point value where 65535 represents 100%. Idle work can be executing without affecting the reported Idle CPU value. Idle execution is monitored over a fixed slice of time. This is then converted into a value that can be represented as a percentage.

Percent Idle CPU (floating point)

The percentage of time that the CPU is considered idle exported as floating point value. Idle work can be executing without affecting the reported Idle CPU value. Idle execution is monitored over a fixed slice of time. Typically the fixed point version is read and then floating point math used to convert the fixed point value into a floating point value.

Foreground Stack Min Bytes Free

The minimum number of bytes free in the ClassicControlCore foreground task. Replaces this legacy block.

Background Stack Min Bytes Free

The minimum number of bytes free in the ClassicControlCore background task. Replaces this legacy block.

Idle Stack Min Bytes Free

The minimum number of bytes free in the ClassicControlCore idle task. Replaces this legacy block.

Spin Lock Peak Wait Time

Multicore implementations use synchronization objects to prevent multiple cores from accessing the same resources at the same time. A core that attempts to access a resource that another core has posessed via a lock will be forced to wait until that lock is released. It waits by "spinning" in a do-nothing loop. This attribute returns the peak time that a core has been forced to "spin" in this manner for the lock that is identified by the text after the hyphen.

This attribute supports an additional Action on Read configuration. This can be used to zero the diagnostic after it is read or leave it unchanged.

These attributes will return zero when requested on a module that is not multicore capable (since there is not another core to wait on), and also when using a multicore capable module that has been configured to only use a single core.