Loading drivers/media/platform/msm/vidc/msm_vidc_debug.c +8 −0 Original line number Diff line number Diff line Loading @@ -519,3 +519,11 @@ void msm_vidc_debugfs_update(struct msm_vidc_inst *inst, } } int msm_vidc_check_ratelimit(void) { static DEFINE_RATELIMIT_STATE(_rs, VIDC_DBG_SESSION_RATELIMIT_INTERVAL, VIDC_DBG_SESSION_RATELIMIT_BURST); return __ratelimit(&_rs); } drivers/media/platform/msm/vidc/msm_vidc_debug.h +21 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,14 @@ #define VIDC_DBG_LABEL "msm_vidc" #endif /* * This enforces a rate limit: not more than 6 messages * in every 1s. */ #define VIDC_DBG_SESSION_RATELIMIT_INTERVAL (1 * HZ) #define VIDC_DBG_SESSION_RATELIMIT_BURST 6 #define VIDC_DBG_TAG VIDC_DBG_LABEL ": %4s: " /* To enable messages OR these values and Loading Loading @@ -66,6 +74,18 @@ extern bool msm_vidc_dyn_gov_debug; } \ } while (0) #define dprintk_ratelimit(__level, __fmt, arg...) \ do { \ if (msm_vidc_debug & __level) { \ if (msm_vidc_debug_out == VIDC_OUT_PRINTK && \ msm_vidc_check_ratelimit()) { \ pr_info(VIDC_DBG_TAG __fmt, \ get_debug_level_str(__level), \ ## arg); \ } \ } \ } while (0) #define MSM_VIDC_ERROR(value) \ do { if (value) \ dprintk(VIDC_DBG, "BugOn"); \ Loading @@ -81,6 +101,7 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst, void msm_vidc_debugfs_deinit_inst(struct msm_vidc_inst *inst); void msm_vidc_debugfs_update(struct msm_vidc_inst *inst, enum msm_vidc_debugfs_event e); int msm_vidc_check_ratelimit(void); static inline char *get_debug_level_str(int level) { Loading drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +1 −1 Original line number Diff line number Diff line Loading @@ -949,7 +949,7 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain, if (core->smmu_fault_handled) { if (core->resources.non_fatal_pagefaults) { dprintk(VIDC_ERR, dprintk_ratelimit(VIDC_ERR, "%s: non-fatal pagefault address: %lx\n", __func__, iova); return 0; Loading Loading
drivers/media/platform/msm/vidc/msm_vidc_debug.c +8 −0 Original line number Diff line number Diff line Loading @@ -519,3 +519,11 @@ void msm_vidc_debugfs_update(struct msm_vidc_inst *inst, } } int msm_vidc_check_ratelimit(void) { static DEFINE_RATELIMIT_STATE(_rs, VIDC_DBG_SESSION_RATELIMIT_INTERVAL, VIDC_DBG_SESSION_RATELIMIT_BURST); return __ratelimit(&_rs); }
drivers/media/platform/msm/vidc/msm_vidc_debug.h +21 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,14 @@ #define VIDC_DBG_LABEL "msm_vidc" #endif /* * This enforces a rate limit: not more than 6 messages * in every 1s. */ #define VIDC_DBG_SESSION_RATELIMIT_INTERVAL (1 * HZ) #define VIDC_DBG_SESSION_RATELIMIT_BURST 6 #define VIDC_DBG_TAG VIDC_DBG_LABEL ": %4s: " /* To enable messages OR these values and Loading Loading @@ -66,6 +74,18 @@ extern bool msm_vidc_dyn_gov_debug; } \ } while (0) #define dprintk_ratelimit(__level, __fmt, arg...) \ do { \ if (msm_vidc_debug & __level) { \ if (msm_vidc_debug_out == VIDC_OUT_PRINTK && \ msm_vidc_check_ratelimit()) { \ pr_info(VIDC_DBG_TAG __fmt, \ get_debug_level_str(__level), \ ## arg); \ } \ } \ } while (0) #define MSM_VIDC_ERROR(value) \ do { if (value) \ dprintk(VIDC_DBG, "BugOn"); \ Loading @@ -81,6 +101,7 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst, void msm_vidc_debugfs_deinit_inst(struct msm_vidc_inst *inst); void msm_vidc_debugfs_update(struct msm_vidc_inst *inst, enum msm_vidc_debugfs_event e); int msm_vidc_check_ratelimit(void); static inline char *get_debug_level_str(int level) { Loading
drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +1 −1 Original line number Diff line number Diff line Loading @@ -949,7 +949,7 @@ int msm_vidc_smmu_fault_handler(struct iommu_domain *domain, if (core->smmu_fault_handled) { if (core->resources.non_fatal_pagefaults) { dprintk(VIDC_ERR, dprintk_ratelimit(VIDC_ERR, "%s: non-fatal pagefault address: %lx\n", __func__, iova); return 0; Loading