printk_timed_ratelimit 使用 , 可以防止 打太多log kernel 发生 soft lockup卡死

+        if (printk_timed_ratelimit(&max_err_time, 10 * 1000)) \
+                   pr_warn("CIF ISP2.0 %s: " fmt, \
+                           __func__, ## arg); \

Name

printk_timed_ratelimit — caller-controlled printk ratelimiting

Synopsis

bool printk_timed_ratelimit ( unsigned long *   caller_jiffies,
  unsigned int   interval_msecs);

Arguments

caller_jiffies

pointer to caller's state

interval_msecs

minimum interval between prints

Description

printk_timed_ratelimit returns true if more than interval_msecs milliseconds have elapsed since the last time printk_timed_ratelimit returned true.

你可能感兴趣的:(printk_timed_ratelimit 使用 , 可以防止 打太多log kernel 发生 soft lockup卡死)