Skip to content

Commit e5f1cad

Browse files
committed
kernel/mem_leak_checker: Disable km4 log print when mem leak checking for rtl8730e
A thread of mem leak checker has the highest priority to check all heaps. At this time, log thread can not run and print logs from km4 because of mem leak checker. Then some error logs will be shown like below. WARN: KM4 logbuf full, dropped log! WARN: KM4 logbuf full, dropped log! So we set reboot reason temporaily while checking mem leaks to avoid km4 log print.
1 parent 6d52cea commit e5f1cad

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

os/arch/arm/src/amebasmart/amebasmart_reboot_reason.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum {
2727
REBOOT_SYSTEM_BOD_RESET = REBOOT_BOARD_SPECIFIC3, /* Brownout reset */
2828
REBOOT_SYSTEM_TZWD_RESET = REBOOT_BOARD_SPECIFIC4, /* TrustZone Watch dog */
2929
REBOOT_SYSTEM_NP_LP_FAULT = REBOOT_BOARD_SPECIFIC5, /* Reset due to fault in KM4/KM0 */
30+
REBOOT_TEMP_BLOCK_KM4_LOG = REBOOT_BOARD_SPECIFIC6, /* Temporal reboot reason setting to disable KM4 log print */
3031
};
3132

3233
#endif /* __AMEBASMART_REBOOT_REASON_H__ */

os/kernel/debug/mem_leak_checker.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include <binary_manager/binary_manager.h>
3333
#include <arch/chip/memory_region.h>
3434
#include <tinyara/binfmt/elf.h>
35+
#if defined(CONFIG_ARCH_BOARD_RTL8730E)
36+
#include <tinyara/reboot_reason.h>
37+
#endif
3538

3639
/****************************************************************************
3740
* Pre-processor Definitions
@@ -377,6 +380,11 @@ int run_mem_leak_checker(int checker_pid, char *bin_name)
377380
int broken_cnt = 0;
378381
struct mm_heap_s *heap = NULL;
379382

383+
#if defined(CONFIG_ARCH_BOARD_RTL8730E)
384+
/* Set reboot reason temporaily to avoid km4 log print */
385+
WRITE_REBOOT_REASON(REBOOT_TEMP_BLOCK_KM4_LOG);
386+
#endif
387+
380388
if (strncmp(bin_name, "kernel", strlen("kernel") + 1) == 0) {
381389
heap = kmm_get_baseheap();
382390
}
@@ -415,6 +423,12 @@ int run_mem_leak_checker(int checker_pid, char *bin_name)
415423
print_info(heap, leak_cnt, broken_cnt);
416424

417425
hash_deinit();
426+
427+
#if defined(CONFIG_ARCH_BOARD_RTL8730E)
428+
/* Clear reboot reason to enable km4 log print again */
429+
CLEAR_REBOOT_REASON();
430+
#endif
431+
418432
return OK;
419433
}
420434

0 commit comments

Comments
 (0)