LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2014, 02:57 AM   #1
Ananda Bbau
LQ Newbie
 
Registered: May 2012
Posts: 9

Rep: Reputation: Disabled
where to change in linux code to convert dmesg uptime to UTC format(human readable)


Hi All,

I changed the line CONFIG_PRINTK_TIME=y in kernel-2.6.32-x86_64.config to get dmesg timestamp. I am getting the time stamp in the following:
[ 5.967800] mbr: 0x80 0x00 0x00 0x00 0x01 0x01 0x00 0x83 0x55 0xaa
[ 5.974417] sd 0:2:0:0: [sda] 285155328 512-byte logical blocks: (145 GB/135 GiB)
[ 5.982530] sd 0:2:0:0: [sda] Write Protect is off

I want to convert this uptime demsg to UTC format dmesg (Human readable format). For that where do i need to change in linux code. I dont want any script and all. I need to change in linux code and need to install the image in several servers.
 
Old 04-10-2014, 03:07 AM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
doesn't this do it?
Code:
TZ=UTC dmesg -T
 
Old 04-10-2014, 03:17 AM   #3
Ananda Bbau
LQ Newbie
 
Registered: May 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Berhanie View Post
doesn't this do it?
Code:
TZ=UTC dmesg -T
Hi Berhanie,

Where do i need to set this (path)?
 
Old 04-10-2014, 03:19 AM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
this is the command. just type it into a terminal.
 
Old 04-10-2014, 03:22 AM   #5
Ananda Bbau
LQ Newbie
 
Registered: May 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Berhanie View Post
this is the command. just type it into a terminal.
Ok.. Thanks for your kind information. But everytime i dont type this command in termainal. The server booting time itself , i need to see the dmesg time stamp in UTC format not in uptime.
 
Old 04-10-2014, 03:24 AM   #6
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
The "timestamp" you are seeing in every record is a monotonically increasing timestamp in microseconds (unsigned 64 bit integer) There is no code in the kernel to output it in a date format.
 
Old 04-10-2014, 09:12 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
Quote:
Originally Posted by fpmurphy View Post
The "timestamp" you are seeing in every record is a monotonically increasing timestamp in microseconds (unsigned 64 bit integer) There is no code in the kernel to output it in a date format.
This is partly because during parts of the boot (device initialization) there is no date available yet.
 
Old 04-10-2014, 07:41 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,054

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
That "time-stamp" is kernel active time since boot. It's a duration, not a date. And it has holes in it, although as pointed out, guaranteed to be increasing. Useful for the kernel (devs), maybe not the rest of us.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Convert field from epoch to human readable sebelk Programming 6 01-08-2012 03:13 AM
LXer: How to make dmesg timestamp human readable LXer Syndicated Linux News 0 11-13-2011 08:30 PM
[SOLVED] Simple Linux script to convert datetime format to UTC format shayno90 Linux - Newbie 10 10-09-2009 09:19 AM
Converting a date in MySQL format to human readable in Perl resetreset Programming 7 02-11-2009 08:14 AM
Webalizer - howto convert the trafic into human readable? sys7em Linux - Server 3 09-25-2006 05:48 AM


All times are GMT -5. The time now is 12:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration