11/*
2- * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
1111#include "freertos/task.h"
1212
1313/*
14- * This header contains private API used by various ESP-IDF debugging features (e.g., esp_gdbstub).
14+ * This header contains public API for FreeRTOS debugging features including task snapshots.
15+ * These APIs are used by ESP-IDF debugging features (e.g., esp_gdbstub, core dump) and
16+ * external frameworks (e.g., ESP Insights) for debugging and monitoring purposes.
1517 */
1618
1719/* *INDENT-OFF* */
@@ -71,7 +73,9 @@ int xTaskGetNext( TaskIterator_t * xIterator );
7173 * - This function is used by the panic handler to get the snapshot of a particular task.
7274 *
7375 * @note This function should only be called when FreeRTOS is no longer running (e.g., during a panic) as this function
74- * does not acquire any locks.
76+ * does not acquire any locks. For safe usage with scheduler running, use vTaskSuspendAll() before calling
77+ * this function and xTaskResumeAll() after.
78+ *
7579 * @param[in] pxTask Task's handle
7680 * @param[out] pxTaskSnapshot Snapshot of the task
7781 * @return pdTRUE if operation was successful else pdFALSE
@@ -85,11 +89,13 @@ BaseType_t vTaskGetSnapshot( TaskHandle_t pxTask,
8589 * - This function is used by the panic handler to get a snapshot of all tasks in the system
8690 *
8791 * @note This function should only be called when FreeRTOS is no longer running (e.g., during a panic) as this function
88- * does not acquire any locks.
92+ * does not acquire any locks. For safe usage with scheduler running, use vTaskSuspendAll() before calling
93+ * this function and xTaskResumeAll() after.
94+ *
8995 * @param[out] pxTaskSnapshotArray Array of TaskSnapshot_t structures filled by this function
9096 * @param[in] uxArrayLength Length of the provided array
9197 * @param[out] pxTCBSize Size of the a task's TCB structure (can be set to NULL)
92- * @return UBaseType_t
98+ * @return UBaseType_t Number of task snapshots filled in the array
9399 */
94100UBaseType_t uxTaskGetSnapshotAll ( TaskSnapshot_t * const pxTaskSnapshotArray ,
95101 const UBaseType_t uxArrayLength ,
0 commit comments