内核使用printk打印出这句log: [ 1463.495062] [5:11331:Binder:1385_1A] [log]
前面的时间戳1463.495062表示1463s+495062us
内核对printk时间戳进行如何处理请看源码
static size_t print_time(u64 ts, char *buf)
{
unsigned long rem_nsec;
if (!printk_time)
return 0;
rem_nsec = do_div(ts, 1000000000); // do_div是除法函数,ts=ts/1000000000,将ts的时间单位从ns转化为s,返回余下的ns值
if (!buf)
return snprintf(NULL, 0, "[%5lu.000000] ", (unsigned long)ts);
return sprintf(buf, "[%5lu.%06lu] ",
(unsigned long)ts, rem_nsec / 1000); //最终会以s.us的形式打印出来
}