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: Ruchit <ruchitmarathe@gmail.com>
fourteen
Sultan Alsawaf 4 years ago committed by Jenna
parent 9887b4e6de
commit c315ea8471
  1. 2
      drivers/media/platform/msm/camera/cam_utils/Makefile
  2. 48
      drivers/media/platform/msm/camera/cam_utils/cam_debug_util.h

@ -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

@ -67,8 +67,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()
@ -77,7 +79,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;
}
#if defined(CONFIG_SEC_A71_PROJECT)
#define CAM_QCLOGMINIMAL(__module, fmt, args...) \
@ -99,8 +104,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
@ -110,8 +114,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
@ -121,8 +124,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
@ -133,8 +135,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_err_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
@ -146,16 +147,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
@ -173,8 +165,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
@ -186,15 +177,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_ */

Loading…
Cancel
Save