msm: camera: Stub out the camera_debug_util API and compile it out

A measurably significant amount of CPU time is spent in these routines
while the camera is open. These are also responsible for a grotesque
amount of dmesg spam, so let's nuke them.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
Sultan Alsawaf 2020-12-26 18:49:20 -08:00 committed by azrim
parent dc5306d206
commit d0fd6ebbed
No known key found for this signature in database
GPG Key ID: 497F8FB059B45D1C
2 changed files with 16 additions and 34 deletions

View File

@ -2,5 +2,5 @@ ccflags-y += -Idrivers/media/platform/msm/camera/cam_core/
ccflags-y += -Idrivers/media/platform/msm/camera/cam_req_mgr/
ccflags-y += -Idrivers/media/platform/msm/camera/cam_smmu/
obj-$(CONFIG_SPECTRA_CAMERA) += cam_soc_util.o cam_io_util.o cam_packet_util.o cam_debug_util.o cam_trace.o cam_common_util.o
obj-$(CONFIG_SPECTRA_CAMERA) += cam_soc_util.o cam_io_util.o cam_packet_util.o cam_trace.o cam_common_util.o
obj-$(CONFIG_SPECTRA_CAMERA) += cam_cx_ipeak.o

View File

@ -63,8 +63,10 @@
* @fmt : Formatted string which needs to be print in the log
*
*/
void cam_debug_log(unsigned int module_id, const char *func, const int line,
const char *fmt, ...);
static inline void cam_debug_log(unsigned int module_id, const char *func,
const int line, const char *fmt, ...)
{
}
/*
* cam_get_module_name()
@ -73,7 +75,10 @@ void cam_debug_log(unsigned int module_id, const char *func, const int line,
*
* @module_id : Module ID which is using this function
*/
const char *cam_get_module_name(unsigned int module_id);
static inline const char *cam_get_module_name(unsigned int module_id)
{
return NULL;
}
/*
* CAM_ERR
@ -84,8 +89,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @args : Arguments which needs to be print in log
*/
#define CAM_ERR(__module, fmt, args...) \
pr_err("CAM_ERR: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__, __LINE__, ##args)
cam_debug_log(__module, __func__, __LINE__, fmt, ##args)
/*
* CAM_WARN
* @brief : This Macro will print warning logs
@ -95,8 +99,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @args : Arguments which needs to be print in log
*/
#define CAM_WARN(__module, fmt, args...) \
pr_warn("CAM_WARN: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__, __LINE__, ##args)
cam_debug_log(__module, __func__, __LINE__, fmt, ##args)
/*
* CAM_INFO
* @brief : This Macro will print Information logs
@ -106,8 +109,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @args : Arguments which needs to be print in log
*/
#define CAM_INFO(__module, fmt, args...) \
pr_info("CAM_INFO: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__, __LINE__, ##args)
cam_debug_log(__module, __func__, __LINE__, fmt, ##args)
/*
* CAM_INFO_RATE_LIMIT
@ -118,8 +120,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @args : Arguments which needs to be print in log
*/
#define CAM_INFO_RATE_LIMIT(__module, fmt, args...) \
pr_info_ratelimited("CAM_INFO: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__, __LINE__, ##args)
cam_debug_log(__module, __func__, __LINE__, fmt, ##args)
/*
* CAM_INFO_RATE_LIMIT_CUSTOM
@ -131,16 +132,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @fmt : Formatted string which needs to be print in log
* @args : Arguments which needs to be print in log
*/
#define CAM_INFO_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
(interval * HZ), \
burst); \
if (__ratelimit(&_rs)) \
pr_info("CAM_INFO: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__,\
__LINE__, ##args); \
})
#define CAM_INFO_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...)
/*
* CAM_DBG
@ -158,8 +150,7 @@ const char *cam_get_module_name(unsigned int module_id);
* @brief : This Macro will print error print logs with ratelimit
*/
#define CAM_ERR_RATE_LIMIT(__module, fmt, args...) \
pr_err_ratelimited("CAM_ERR: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__, __LINE__, ##args)
cam_debug_log(__module, __func__, __LINE__, fmt, ##args)
/*
* CAM_ERR_RATE_LIMIT_CUSTOM
@ -171,15 +162,6 @@ const char *cam_get_module_name(unsigned int module_id);
* @fmt : Formatted string which needs to be print in log
* @args : Arguments which needs to be print in log
*/
#define CAM_ERR_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...) \
({ \
static DEFINE_RATELIMIT_STATE(_rs, \
(interval * HZ), \
burst); \
if (__ratelimit(&_rs)) \
pr_err("CAM_ERR: %s: %s: %d " fmt "\n", \
cam_get_module_name(__module), __func__,\
__LINE__, ##args); \
})
#define CAM_ERR_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...)
#endif /* _CAM_DEBUG_UTIL_H_ */