Files
SDK_SG200x_V2/osdrv/interdrv/v2/base/base_debug.h
carbon 0545e9dc6d init version 2024-05-07
commit d1edce71135cc6d98c0a4b5729774542b676e769
Author: sophgo-forum-service <forum_service@sophgo.com>
Date:   Fri Mar 15 16:07:33 2024 +0800

    [fix] recommend using ssh method to clone repo.
    [fix] fix sensor driver repo branch name.
2024-05-07 19:36:36 +08:00

34 lines
1.2 KiB
C

#ifndef _BASE_DEBUG_H_
#define _BASE_DEBUG_H_
#include <linux/debugfs.h>
extern u32 base_log_lv;
#define CVI_BASE_DBG_ERR 0x1 /* error conditions */
#define CVI_BASE_DBG_WARN 0x2 /* warning conditions */
#define CVI_BASE_DBG_NOTICE 0x4 /* normal but significant condition */
#define CVI_BASE_DBG_INFO 0x8 /* informational */
#define CVI_BASE_DBG_DEBUG 0x10 /* debug-level messages */
#define CVI_TRACE_BASE(level, fmt, ...) \
do { \
if (level <= base_log_lv) { \
if (level == CVI_BASE_DBG_ERR) \
pr_err("%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); \
else if (level == CVI_BASE_DBG_WARN) \
pr_warn("%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); \
else if (level == CVI_BASE_DBG_NOTICE) \
pr_notice("%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); \
else if (level == CVI_BASE_DBG_INFO) \
pr_info("%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); \
else if (level == CVI_BASE_DBG_DEBUG) \
pr_debug("%s:%d(): " fmt, __func__, __LINE__, ##__VA_ARGS__); \
} \
} while (0)
#endif /* _BASE_DEBUG_H_ */