History log of /optee_os/lib/libutils/isoc/include/malloc.h (Results 26 – 31 of 31)
Revision Date Author Comments
# d4ce92c3 02-Dec-2015 Pascal Brand <pascal.brand@st.com>

alloc: Remove mdbg_mode

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>


# 0fcbddd4 11-Nov-2015 SY Chiu <sy.chiu@linaro.org>

debug: enable bget memory leak detection

This patch enables memory leak detection in bget_malloc.c.
This is very helpful to find memory leakage issue in teecore
or user TA. To enable it in teecore,

debug: enable bget memory leak detection

This patch enables memory leak detection in bget_malloc.c.
This is very helpful to find memory leakage issue in teecore
or user TA. To enable it in teecore, build optee_os with
`CFG_TEE_CORE_MALLOC_DEBUG=y`. For user TA, build optee_os
with `CFG_TEE_TA_MALLOC_DEBUG=y`.

Then, add the following statement at some point of your
code that might frequently been triggered:

mdbg_check(1);

It will dump allocated memory blocks and the holders of
them. If you find a memory block appears multiple times
after the system runs a period of time, it is very likely
the source of memory leakage.

Here is an example output:

ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 0 bytes core/tee/tee_svc_storage.c:260
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 104 bytes core/tee/tee_svc_storage.c:444
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 18 bytes core/tee/tee_pobj.c:119
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 56 bytes core/tee/tee_pobj.c:110
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 192 bytes core/arch/arm/mm/tee_mmu.c:93
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/arch/arm/mm/tee_mmu.c:241
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 224 bytes core/arch/arm/kernel/tee_ta_manager.c:573
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 72 bytes core/arch/arm/kernel/tee_ta_manager.c:1202
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/kernel/handle.c:70
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48
ERR TEE-CORE:mdbg_check:720: Ignore buffer: 16 bytes lib/libutils/isoc/bget_malloc.c:794

You can see the buffer hold by strdup.c:34 appears 4 times,
so it's very likely to be the source of memory leakage.

Signed-off-by: SY Chiu <sy.chiu@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Tested-by: SY Chiu <sy.chiu@linaro.org> (MT8173 EVB)

show more ...


# 074ba9b2 09-Oct-2014 Jens Wiklander <jens.wiklander@linaro.org>

Move bget to libutils replacing dlmalloc

* Moves bget to libutils replacing dlmalloc as kernel memory allocator
* Restores the code formatting of bget.{c,h} to the original state as
parts of the c

Move bget to libutils replacing dlmalloc

* Moves bget to libutils replacing dlmalloc as kernel memory allocator
* Restores the code formatting of bget.{c,h} to the original state as
parts of the current code was unreadable
* Adds malloc_add_pool() to make use of previously unused memory
* Moves call to malloc_init() into platform specific code
* Restores MDBG into working condition
* Adds memalign function to bget.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU virt platform)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (FVP)
Reviewed-by: Etienne Carriere <etienne.carriere@st.com>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)

show more ...


# 2c276d68 08-Sep-2014 Pascal Brand <pascal.brand@st.com>

"Core Status" service on malloc

- Gets teecore heap info.
- Enabled only on CFG_TEE_FW_DEBUG != 0.
- Update dirty tests
- Reset max allocated size after malloc dirty tests.


# 85411494 06-Aug-2014 Pascal Brand <pascal.brand@st.com>

Cleanup Libtomcrypt

- Do not compile libtomcrypt tests anymore
- Define LTC_NO_FILE to remove all file operations in libtomcrypt
- Minor fix in argument description of malloc

Signed-off-by: Pascal

Cleanup Libtomcrypt

- Do not compile libtomcrypt tests anymore
- Define LTC_NO_FILE to remove all file operations in libtomcrypt
- Minor fix in argument description of malloc

Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...


# b0104773 12-Jun-2014 Pascal Brand <pascal.brand@st.com>

Open-source the TEE Core

Signed-off-by: Pascal Brand <pascal.brand@st.com>


12