<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hello,list<br>
</p>
<p><br>
</p>
<p>I notice a new option about "log -T",<span style="font-size:12pt">which translates the leading</span><span style="font-size:12pt"> timestamp value of each message into human readable format.</span><span style="font-size:12pt">​i have checked the code,the
 implementation mainly consists of two steps:</span></p>
<p><span style="font-size:12pt">1.use "kt->boot_date.tv_sec=kt->date.tv_sec - uptime_sec" to get system bootup time,<span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">uptime_sec</span> is come from
 jiffies</span></p>
<p><span style="font-size:12pt">2.use "kt->boot_date.tv_sec + nanos" to translates readable timestamp in every log entry.</span></p>
<p><span style="font-size:12pt"></span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">This change does not take into account the system sleep,<span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">once </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">system</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"> suspend </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">this </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">translation</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"> 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.</span></span></p>
<p><span style="font-size:12pt"><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)"><br>
</span></span></p>
<p><span style="font-size:12pt">As far as i know​ w</span><span style="font-size:12pt">e ca</span><span style="font-size:12pt">n’t get the correct conversion time once the system sleeps.so we have to restrict​ this option only work in non-suspend state.</span></p>
<p><span style="font-size:12pt">patch is attached.</span></p>
<div><br>
</div>
<div>wrong log:​<br>
</div>
<div>
<div>[Thu May  7 <span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">
03:27:38</span> 2020] PM: suspend entry 2020-05-06 <span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">
19:22:40</span>.481371186 UTC<br>
</div>
<div>[Thu May  7 <span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">
03:27:38</span> 2020] PM: suspend exit 2020-05-06 <span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">
19:22:49</span>.168938838 UTC<br>
</div>
<div>...<br>
<span style="font-size:12pt">[Thu May  7 </span><span style="font-size:12pt; color:rgb(255,0,0)">03:29:</span><span style="font-size:12pt; color:rgb(255,0,0)"><span style=""><span>02</span></span></span><span style="font-size:12pt"> 20</span><span style="font-size:12pt">20]
 PM: suspend entry 2020-05-06 </span><span style="font-size:12pt; color:rgb(255,0,0)">19:28:</span><span style="font-size:12pt; color:rgb(255,0,0)"><span>54</span></span><span style="font-size:12pt">.</span><span style="font-size:12pt">366349876</span><span style="font-size:12pt">
 UTC</span></div>
</div>
<div>[Thu May  7 <span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">
03:29:</span><span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">03</span> 2020] PM: suspend exit 2020-05-06
<span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">19:29:</span><span style="text-decoration:none solid rgb(255,0,0); color:rgb(255,0,0)"><span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">03</span></span>.162471747
 UTC<br>
</div>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size: 12pt; color: rgb(255, 0, 0); text-decoration: none solid rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0); text-decoration: none solid rgb(255, 0, 0);">timestamp=utc+8</span></span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Thanks</span></p>
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! 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!******/#
</body>
</html>