Metrics_Integration_Manual
Contents
Dependencies
Module | Required Feature |
---|---|
Rte | Rte_Task_Dispatch() hooks VFB Trace hooks |
Dio | Dio_WriteChannel() |
Port | Port_SetPinDirection() |
NxtrLib | DtrmnElapsedTime_uS_u32() GetSystemTime_uS_u32() |
Os | osdNumberOfAllTasks constant value osGetStackUsage oskTcbStackTop oskTcbStackBottom |
Configuration
Build Time Config
Constant | Notes | SWC |
---|---|---|
BC_METRICS_TASKCPUUSEMASK | STD_ON enables build of the task use masking functionality to excluded a user defined set of task CPU use times from the CPU use calculation. | |
BC_METRICS_STACKUSE | STD_ON enables build of the Stack Use monitoring | Metrics |
BC_METRICS_CPUUSEDIO | STD_ON enables build of the CPU Use digital output based monitoring | Metrics |
BC_METRICS_CPUUSETMR | STD_ON enables build of the CPU Use timer based monitoring | Metrics |
ENABLE_CPUUSE_DIO | If defined then CPU usage is output via a DIO where the DIO is high while the CPU is not in the background task. | Metrics |
RTE_VFB_TRACE=1 | Enable Rte’s VFB trace functionality to support Rte_Task_Dispatch() hooks | Rte |
Rte_Task_Dispatch | Enable Rte’s Rte_Task_Dispatch() hooks | Rte |
Generator Config
Constant | Notes | SWC |
---|---|---|
Dio Channel Name: “Metrics” | Required when ENABLE_CPUUSE_DIO is defined | Dio |
RTE VFB Trace Hooks |
Caveats:
| |
MPU Global Read Access | GetSystemTime and Dio_WriteChannel Metrics Channel accessed registers must be readable across all application and ISR contexts. | Os |
MPU Global Read/Write Access | Metrics data structures must be R/W across all application and ISR contexts. ATTENTION! The metrics data structures are very large, so ensure that adequate memory is allocated to the Global Shared region | OS |
Integration Project Changes
Modify the required BSW Irq source functions to place the Metrics_TaskStart and Metrics_TaskEnd hooks around the ISR’s. The recommended practice is to make a copy of the delivered source file renamed to *_NxtrMetrics.c and conditionaly build the altered file in place of the delivered file for Metrics builds.
Modify SchM.c to place the Metrics_TaskStart hook and Metrics_TaskEnd calls appropriately at around the tasks. Note that it might be necessary to place the hooks at a point in the task that will be overwritten when the SchM.c is generated. Diligence will need to used after generation to ensure that the hooks are not inadvertently removed.
Modify ApplCallbacks.c to place Metrics_TaskStart and Metrics_TaskEnd calls appropriately around tasks. Dilligence will be required to ensure the hooks are not removed.
Memory Mapping
Mapping
Constant | Notes |
---|---|
METRICS_START_SEC_VAR_CLEARED_UNSPECIFIED | Writable across all applications |
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
Feature | RAM | ROM |
---|---|---|
Software task time stamping of task execution | ||
Stack usage monitoring |
Item # | Rev # | Change Description | Date | Author Initials |
---|---|---|---|---|
1 |