public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: George Nychis <gnychis@cmu.edu>
To: Sitsofe Wheeler <sitsofe@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: printing current system time from kernel space
Date: Mon, 22 Sep 2008 11:11:13 -0400	[thread overview]
Message-ID: <48D7B591.8000408@cmu.edu> (raw)
In-Reply-To: <48D74431.8050805@yahoo.com>



Sitsofe Wheeler wrote:
> George Nychis wrote:
>> I spent some time googling, but could not find out how or if it is 
>> possible to read the current system time in kernel space.  I could 
>> insert a printk() somewhere in usbdev_read() then.
> 
> If that's what you want to do could you not turn on timestamps on printk 
> (CONFIG_PRINTK_TIME in the kernel hacking menu)?
> 

Thanks for the response!

You might be misunderstanding my goal.  I need a common clock between 
kernel and user space, so that I can say:

Event1 happened at time X in the kernel
Event2 happened at time X+Y in user space
The time between Event1 and Event2 was Y-X

So, turning off timestamps does not help anything here :)

What might be useful is if user space can read the current timestamp 
value that printk uses, that way I can just do a printk in the kernel 
and then read the value and print in user space.

Is this possible?

Thanks!
George

  reply	other threads:[~2008-09-22 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22  5:18 printing current system time from kernel space George Nychis
2008-09-22  7:07 ` Sitsofe Wheeler
2008-09-22 15:11   ` George Nychis [this message]
2008-09-22 20:28 ` john stultz
2008-09-22 20:30   ` john stultz
2008-09-22 20:33     ` George Nychis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48D7B591.8000408@cmu.edu \
    --to=gnychis@cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sitsofe@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox