Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding the kernel dmesg timestamp

I want to decode the time format in the kernel logs:

<3>[  107.236115]

<3>[  107.245076]

<4>[  107.521858]

<3>[  107.522098]

Is there any way to convert those time stamps into a "min:sec:msec" format?

I found some scripts to decode which are working but during runtime, here I already have a log and want to decode it manually.

like image 462
srujan Avatar asked Dec 19 '22 00:12

srujan


1 Answers

The format is simple: <N> means the log level is N, then inside of [] there is the time in seconds since the last system boot.

So [ 107.245076] means the message was logged 107 seconds and 245076 microseconds (1 min 47 s 245 ms) after the last boot.

Keep in mind, however, that this is not the wall-clock time, it's the time when the kernel was running. It may stop if the system is suspended which is quite common on embedded devices, especially Android-based ones.

like image 153
Krzysztof Adamski Avatar answered Mar 03 '23 05:03

Krzysztof Adamski