Get Task Info

This MotoHawk™ block allows a model to read configuration and status information from a referenced task.

Block ID

Get Task Info

Library

motohawk_tasking_lib/Metric Blocks

Description

This MotoHawk™ block allows a model to read configuration and status information from a referenced task. The information available to MotoHawk™ is dependent upon the Target OS used to implement the task, 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 a task executing within a specific Target OS.

Typical status type information includes attributes like current percentage of CPU spent executing a particular task, or the worst case stack depth that has been observed. Configuration type attributes include a runtime query of the stack size declared for the referenced task.

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

This block allows the application to implement a custom application monitor.

Block Parameters

Parameter Field Values Comments/Description
Reference Task Single quote enclosed alpha numeric The name of the Task Definition that is to be queried.
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 a task executing within a particular OS may result in an error or warning depending upon how Unsupported Handling has been configured.

For example, selecting Min Free Stack Bytes (forced refresh) 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 Min Free Stack Bytes (forced refresh) 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.
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 Min Free Stack Bytes (forced refresh) 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

Allocated Stack Bytes

The number of bytes allocated to the stack.

Stack Margin Bytes

The number of bytes allocated to the 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.

Min Free Stack Bytes (idle refresh)

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

Min Free Stack Bytes (forced refresh)

Unlike the idle refresh, querying this attribute will force the calculation to occur when the block executes rather than report the last value calculated during idle.

Percent CPU Consumed (fixed point)

A fixed point representation of the percentage of time spent executing this task. A value of 65535 represents 100%. The time spent executing a task is measured over a fixed slice of time. This is then converted into a value that can be represented as a percentage.

Percent CPU Consumed (floating point)

The percentage of time spent executing this task exported as floating point value. Typically the fixed point version is read and then floating point math used to convert the fixed point value into a floating point value.