Monitor
Functions to monitor system operations. More...
Data Structures | |
struct | zos_system_monitor_t |
Structure to hold information about a system monitor item. More... | |
Functions | |
zos_result_t | zn_register_system_monitor (zos_system_monitor_t *system_monitor, uint32_t permitted_delay_ms) |
Registers a system monitor with the system monitor thread. More... | |
zos_result_t | zn_unregister_system_monitor (zos_system_monitor_t *system_monitor) |
Unregister system monitor. More... | |
zos_result_t | zn_update_system_monitor (zos_system_monitor_t *system_monitor, uint32_t permitted_delay_ms) |
Updates a system monitor and resets the last update time. More... | |
Detailed Description
Functions to monitor system operations.
Function Documentation
zos_result_t zn_register_system_monitor | ( | zos_system_monitor_t * | system_monitor, |
uint32_t | permitted_delay_ms |
||
) |
Registers a system monitor with the system monitor thread.
A system monitor ensures the ZAP thread or other construct is not locked up. This is done by periodically updating the monitor before a timeout. If the timeout expires a watchdog is triggered which performs a software reset.
A system monitor works as follows:
- Register a system monitor by calling: zn_register_system_monitor()
- Once the monitor is registered, zn_update_system_monitor() MUST be called before permitted_delay milliseconds expires otherwise a watchdog fault will occur.
- Use zn_unregister_system_monitor() to unregister the monitor.
- Note
- ALL system monitors must be unregistered before the ZAP exits, i.e. during zos_deinit()
- Parameters
-
[out] system_monitor
: A pointer to a system monitor object that will be watched [in] permitted_delay_ms
: The maximum time in milliseconds allowed between monitor updates
- Returns
- zos_result_t
- Examples:
- basic/system_monitor/system_monitor.c.
zos_result_t zn_unregister_system_monitor | ( | zos_system_monitor_t * | system_monitor | ) |
Unregister system monitor.
This removes a system monitor.
- Parameters
-
system_monitor
System monitor object to unregister
- Returns
- zos_result_t
- Examples:
- basic/system_monitor/system_monitor.c.
zos_result_t zn_update_system_monitor | ( | zos_system_monitor_t * | system_monitor, |
uint32_t | permitted_delay_ms |
||
) |
Updates a system monitor and resets the last update time.
After a system monitor is registered, this must be called before permitted_delay milliseconds expires otherwise a watchdog will be triggered.
- Parameters
-
[out] system_monitor
: A pointer to a system monitor object to be updated [in] permitted_delay_ms
: The maximum time in milliseconds allowed between monitor updates
- Returns
- zos_result_t
- Examples:
- basic/system_monitor/system_monitor.c.