malloc: Add an option to disable mcheck-backtrace collection
Backtrace collection is relatively expensive and can significantly slow down malloc()-heavy code when mcheck is enabled. Add a new CONFIG_MCHECK_BACKTRACE option (default y) to allow disabling backtrace collection while keeping the other mcheck features (canaries, double-free detection, etc.) enabled. This allows using mcheck with less overhead when caller information is not needed. Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
@@ -130,6 +130,13 @@ Main U-Boot (post-relocation)
|
||||
``malloc dump``. This significantly increases memory overhead and should
|
||||
only be used for debugging. Default: n
|
||||
|
||||
``CONFIG_MCHECK_BACKTRACE``
|
||||
Bool to enable backtrace collection for mcheck caller information. When
|
||||
enabled (the default), each allocation records a stack backtrace showing
|
||||
where it was made. This is useful for debugging memory leaks but adds
|
||||
overhead to every malloc call. Disable this to reduce mcheck overhead
|
||||
while keeping the canary checks and double-free detection. Default: y
|
||||
|
||||
xPL Boot Phases
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user