Hello,list
I notice a new option about "log -T",which translates the leading timestamp
value of each message into human readable format.i have checked the code,the
implementation mainly consists of two steps:
1.use "kt->boot_date.tv_sec=kt->date.tv_sec - uptime_sec" to get system
bootup time,uptime_sec is come from jiffies
2.use "kt->boot_date.tv_sec + nanos" to translates readable timestamp in
every log entry.
This change does not take into account the system sleep,once system suspend this
translation will make error,printk timestamp and jiffies won't be update during
suspend,and system suspend is a common feature,so i think change is a bug.
As far as i know we can’t get the correct conversion time once the system sleeps.so we
have to restrict this option only work in non-suspend state.
patch is attached.
wrong log:
[Thu May 7 03:27:38 2020] PM: suspend entry 2020-05-06 19:22:40.481371186 UTC
[Thu May 7 03:27:38 2020] PM: suspend exit 2020-05-06 19:22:49.168938838 UTC
...
[Thu May 7 03:29:02 2020] PM: suspend entry 2020-05-06 19:28:54.366349876 UTC
[Thu May 7 03:29:03 2020] PM: suspend exit 2020-05-06 19:29:03.162471747 UTC
timestamp=utc+8
Thanks
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from XIAOMI, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!******/#