diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2018-02-21 10:00:49 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2018-02-21 17:21:14 +0100 |
commit | 8c8e144172ed2205d752ec0f5103d3e172e860eb (patch) | |
tree | 9865c0c6746b58c4641ff33e3fe93bd5a8d39f51 /mk/config.mk | |
parent | 0c5bedb538f2012dda85c1a3ec4ccfb76b64a4f0 (diff) |
ta_dev_kit.mk: define ENABLE_MDBG when CFG_TEE_TA_MALLOC_DEBUG is set
In order to use the memory leak detection code, a user-mode TA needs
two things:
- A version of libutils.a that was built with malloc debug code. This
is taken care of by ta/ta.mk which sets ENABLE_MDBG=1 when
CFG_TEE_TA_MALLOC_DEBUG is 'y'.
- The proper declarations for mdbg_malloc(), mdbg_free(), mdbg_check()
etc. as well as the macro redefinitions for malloc(), free() etc. in
the header files when the TA is built. This patch adds the
missing definition of ENABLE_MDBG in ta/mk/ta_dev_kit.mk when
CFG_TEE_TA_MALLOC_DEBUG is 'y'.
In addition, the usage of CFG_TEE_TA_MALLOC_DEBUG and
CFG_TEE_CORE_MALLOC_DEBUG is better documented in mk/conf.mk.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Diffstat (limited to 'mk/config.mk')
-rw-r--r-- | mk/config.mk | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mk/config.mk b/mk/config.mk index 1ffa20de..738b6d10 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -64,7 +64,16 @@ CFG_TEE_CORE_TA_TRACE ?= y # feature. CFG_TEE_CORE_USER_MEM_DEBUG ?= 1 -# If y, enable memory leak detection feature in bget memory allocator. +# If y, enable the memory leak detection feature in the bget memory allocator. +# When this feature is enabled, calling mdbg_check(1) will print a list of all +# the currently allocated buffers and the location of the allocation (file and +# line number). +# Note: make sure the log level is high enough for the messages to show up on +# the secure console! For instance: +# - To debug user-mode (TA) allocations: build OP-TEE *and* the TA with: +# $ make CFG_TEE_TA_MALLOC_DEBUG=y CFG_TEE_TA_LOG_LEVEL=3 +# - To debug TEE core allocations: build OP-TEE with: +# $ make CFG_TEE_CORE_MALLOC_DEBUG=y CFG_TEE_CORE_LOG_LEVEL=3 CFG_TEE_CORE_MALLOC_DEBUG ?= n CFG_TEE_TA_MALLOC_DEBUG ?= n |