|
@@ -1,7 +1,7 @@
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
/*
|
|
|
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
|
|
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#ifndef _CAM_DEBUG_UTIL_H_
|
|
@@ -18,6 +18,8 @@ extern unsigned int debug_drv;
|
|
|
|
|
|
#define CAM_IS_NULL_TO_STR(ptr) ((ptr) ? "Non-NULL" : "NULL")
|
|
|
|
|
|
+#define CAM_LOG_BUF_LEN 512
|
|
|
+
|
|
|
/* Module IDs used for debug logging */
|
|
|
enum cam_debug_module_id {
|
|
|
CAM_CDM, /* bit 0 */
|
|
@@ -192,24 +194,28 @@ enum cam_log_print_type {
|
|
|
CAM_PRINT_BOTH = 0x3,
|
|
|
};
|
|
|
|
|
|
-#define __CAM_LOG_FMT KERN_INFO "%s: %s: %s: %d "
|
|
|
+#define __CAM_LOG_FMT KERN_INFO "%s: %s: %s: %d: %s "
|
|
|
|
|
|
/**
|
|
|
* cam_print_log() - function to print logs (internal use only, use macros instead)
|
|
|
*
|
|
|
- * @type: corresponds to enum cam_log_print_type, selects if logs are printed in log buffer,
|
|
|
+ * @type: Corresponds to enum cam_log_print_type, selects if logs are printed in log buffer,
|
|
|
* trace buffers or both
|
|
|
- * @fmt: formatting string
|
|
|
- * @args: arguments corresponding to formatting string
|
|
|
+ * @module_id: Module calling the log macro
|
|
|
+ * @tag: Tag for log level
|
|
|
+ * @func: Function string
|
|
|
+ * @line: Line number
|
|
|
+ * @fmt: Formatting string
|
|
|
*/
|
|
|
|
|
|
-void cam_print_log(int type, const char *fmt, ...);
|
|
|
+void cam_print_log(int type, int module, int tag, const char *func,
|
|
|
+ int line, const char *fmt, ...);
|
|
|
|
|
|
#define __CAM_LOG(type, tag, module_id, fmt, args...) \
|
|
|
({ \
|
|
|
- cam_print_log(type, __CAM_LOG_FMT fmt, \
|
|
|
- __CAM_LOG_TAG_NAME(tag), __CAM_DBG_MOD_NAME(module_id), __func__, \
|
|
|
- __LINE__, ##args); \
|
|
|
+ cam_print_log(type, \
|
|
|
+ module_id, tag, __func__, \
|
|
|
+ __LINE__, fmt, ##args); \
|
|
|
})
|
|
|
|
|
|
#define CAM_LOG(tag, module_id, fmt, args...) \
|