From 63b8143e32fb02ed8db07d517f8ea2a75de211e0 Mon Sep 17 00:00:00 2001 From: Guillaume Souchere Date: Tue, 21 May 2024 11:37:37 +0200 Subject: [PATCH] docs(heap_debug): Docuement the heap_trace_alloc_pause function Document the newly introduced heap_trace_alloc_pause function in the heap tracing section. --- docs/en/api-reference/system/heap_debug.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/api-reference/system/heap_debug.rst b/docs/en/api-reference/system/heap_debug.rst index f36f1de52b..3d23939584 100644 --- a/docs/en/api-reference/system/heap_debug.rst +++ b/docs/en/api-reference/system/heap_debug.rst @@ -216,7 +216,8 @@ Once you have identified the code which you think is leaking: - Enable the :ref:`CONFIG_HEAP_TRACING_DEST` option. - Call the function :cpp:func:`heap_trace_init_standalone` early in the program, to register a buffer that can be used to record the memory trace. - Call the function :cpp:func:`heap_trace_start` to begin recording all mallocs or frees in the system. Call this immediately before the piece of code which you suspect is leaking memory. -- Call the function :cpp:func:`heap_trace_stop` to stop the trace once the suspect piece of code has finished executing. +- Call the function :cpp:func:`heap_trace_stop` to stop the trace once the suspect piece of code has finished executing. This state will stop the tracing of both allocations and frees. +- Call the function :cpp:func:`heap_trace_alloc_pause` to pause the tracing of new allocations while continuing to trace the frees. Call this immediately after the piece of code which you suspect is leaking memory to prevent any new allocations to be recorded. - Call the function :cpp:func:`heap_trace_dump` to dump the results of the heap trace. The following code snippet demonstrates how application code would typically initialize, start, and stop heap tracing: