1 /* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef COMMON_DEBUG_H 13 #define COMMON_DEBUG_H 14 15 #define OFF 0 16 #define ON 1 17 18 /* 19 * When ENABLE_HOOKING_SYSCALL is ON, 20 * ChCore will print the syscall number before invoking the handler. 21 * Please refer to kernel/syscall/syscall.c. 22 */ 23 #define ENABLE_HOOKING_SYSCALL OFF 24 25 /* 26 * When ENABLE_DETECTING_DOUBLE_FREE_IN_SLAB is ON, 27 * ChCore will check each free operation in the slab allocator. 28 * Please refer to kernel/mm/slab.c. 29 */ 30 #define ENABLE_DETECTING_DOUBLE_FREE_IN_SLAB OFF 31 32 /* 33 * When ENABLE_BACKTRACE_FUNC is ON, 34 * You can use the backtrace function to trace the invoking pipe line. 35 * Please refer to kernel/arch/aarch64/backtrace/backtrace.c. 36 */ 37 #define ENABLE_BACKTRACE_FUNC ON 38 39 /* Ease-of-debug: Make different user processes invoke print in sequence. */ 40 #define ENABLE_PRINT_LOCK ON 41 42 #endif /* COMMON_DEBUG_H */