docs(heap_debug): Docuement the heap_trace_alloc_pause function

Document the newly introduced heap_trace_alloc_pause function in
the heap tracing section.
This commit is contained in:
Guillaume Souchere
2024-05-21 11:37:37 +02:00
parent 3f366d6e8b
commit 63b8143e32

View File

@@ -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: