performance_monitor.h
Generated from performance_monitor.h in platform-idf. Edit the header’s doxygen comments to change this page.
Performance monitoring utilities for CrossPad.
Functions
Section titled “Functions”perf_print_task_stats
Section titled “perf_print_task_stats”void perf_print_task_stats(void)Print FreeRTOS task runtime statistics.
Shows CPU usage percentage for each task. Requires:
- CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
- CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
Declared in performance_monitor.h:37.
perf_print_task_list
Section titled “perf_print_task_list”void perf_print_task_list(void)Print FreeRTOS task list.
Shows task names, states, priorities, and stack usage. Requires CONFIG_FREERTOS_USE_TRACE_FACILITY=y
Declared in performance_monitor.h:45.
perf_print_stack_usage
Section titled “perf_print_stack_usage”void perf_print_stack_usage(void)Print stack high water marks for all tasks.
Shows remaining stack space (in bytes) for each task. Useful for identifying oversized stacks.
Declared in performance_monitor.h:53.
perf_print_heap_stats
Section titled “perf_print_heap_stats”void perf_print_heap_stats(void)Print heap statistics.
Shows free heap, largest free block, minimum free ever, for both internal RAM and SPIRAM (if available).
Declared in performance_monitor.h:61.
perf_print_all_stats
Section titled “perf_print_all_stats”void perf_print_all_stats(void)Print comprehensive performance report.
Combines all statistics into a single formatted report.
Declared in performance_monitor.h:68.
perf_start_monitor
Section titled “perf_start_monitor”bool perf_start_monitor(perf_monitor_config_t *config)Start periodic performance monitoring task.
Creates a low-priority FreeRTOS task that periodically prints performance statistics to the console.
Note: The task runs at priority 1 (very low) to minimize impact
Parameters
config— Monitoring configuration (NULL for defaults)
Returns
Task handle, or NULL on failure
Declared in performance_monitor.h:81.
perf_monitor_config_t
Section titled “perf_monitor_config_t”Configuration for periodic performance monitoring.
| Field | Type | Description |
|---|---|---|
interval_ms | uint32_t | Monitoring interval in milliseconds. |
print_task_stats | bool | Enable task runtime statistics. |
print_stack_usage | bool | Enable stack high water mark reporting. |
print_heap_stats | bool | Enable heap statistics. |
Declared in performance_monitor.h:23.