相隔一定时间才printk一次信息
上次介绍了 dynamic debug 及 print_once
当有时候,你需要10S 内,某个打印语句只打印一次,你就可以使用下面的demo:
int f(){ unsigned long later; later = jiffies + msecs_to_jiffies(1000*10); if (time_after(jiffies, later)) { printk(KERN_ERR " printk some information .... \n"); return -1; }}