1 /* 2 * @ : Copyright (c) 2021 Phytium Information Technology, Inc. 3 * 4 * SPDX-License-Identifier: Apache-2.0. 5 * 6 * @Date: 2021-04-15 11:27:14 7 * @LastEditTime: 2021-04-16 13:40:55 8 * @Description: This files is for 9 * 10 * @Modify History: 11 * Ver Who Date Changes 12 * ----- ------ -------- -------------------------------------- 13 */ 14 15 #ifndef _FT_TRACE_H_ 16 #define _FT_TRACE_H_ 17 18 #ifdef __cplusplus 19 extern "C" 20 { 21 #endif 22 23 #include "ft_debug.h" 24 25 /* define debug log function */ 26 #define FT_MEM_TRACE_ENABLED 27 #define FT_MEM_TRACE_TAG "FT_MEM" 28 #ifdef FT_MEM_TRACE_ENABLED 29 #define FT_MEM_TRACE(format, ...) FT_DEBUG_PRINT_I(FT_MEM_TRACE_TAG, format, ##__VA_ARGS__) 30 #else 31 #define FT_MEM_TRACE(format, ...) 32 #endif 33 34 #define FT_LOGIC_TRACE_ENABLED 35 #define FT_LOGIC_TRACE_TAG "FT_LOGIC" 36 #ifdef FT_LOGIC_TRACE_ENABLED 37 #define FT_LOGIC_TRACE(format, ...) FT_DEBUG_PRINT_I(FT_LOGIC_TRACE_TAG, format, ##__VA_ARGS__) 38 #define FT_MEM_TRACE_DUMP(buf, buflen, tag) dump_hex((buf), (buflen), (tag)) 39 #else 40 #define FT_LOGIC_TRACE(format, ...) 41 #define FT_MEM_TRACE_DUMP(buf, buflen, tag) 42 #endif 43 44 #define __is_print(ch) ((unsigned int)((ch) - ' ') < 127u - ' ') 45 void dump_hex(const u8 *ptr, u32 buflen, const char *tag); 46 void Sdmmc_TraceHeapAlloc(const char *tag); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53