LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-27-2009, 01:15 PM   #1
pmil
Member
 
Registered: Jul 2008
Posts: 43

Rep: Reputation: 15
Post A query regarding printk


Hi all,

I have selected the kernel option that causes timing information to be included in printk output. Now, the problem is that I am using a printk wich includes a CR switch in order to print all printk messages into the same line. However, the timing information is not prefixed to my printk messages but only in the first printk called.

[___19.467071] THIS IS MY PRINTK! <-- That's the first call
THIS IS MY PRINTK!S IS MY PRINTK! <-- All the other printks don't have the timing prefix

Any hints?

Thanks in advance.

Last edited by pmil; 11-27-2009 at 01:18 PM.
 
Old 11-30-2009, 05:19 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Can you share the code of your printk (the one with the CR switch)?
 
Old 11-30-2009, 06:04 AM   #3
pmil
Member
 
Registered: Jul 2008
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by timmeke View Post
Can you share the code of your printk (the one with the CR switch)?
Sure! It's the following:

Code:
printk("THIS IS MY PRINTK!\r");
Thanks!
 
Old 11-30-2009, 10:16 AM   #4
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 228

Rep: Reputation: 54
Quote:
I am using a printk wich includes a CR switch in order to print all printk messages into the same line. However, the timing information is not prefixed to my printk messages but only in the first printk called.
printk prints the time stamp at the beginning of each new line.
As long as no \n is output, there is no new line.
 
Old 12-03-2009, 03:37 PM   #5
pmil
Member
 
Registered: Jul 2008
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by cladisch View Post
printk prints the time stamp at the beginning of each new line.
As long as no \n is output, there is no new line.
I see. So, I should find another way to do it. Thanks a lot!
 
  


Reply



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
problem of printk nesta Programming 1 08-05-2009 02:36 PM
printk(KERN_DEBUG ...) vs printk(...) Sergei Lavrov Linux - Kernel 2 03-25-2007 04:41 PM
Printk is not printing allomeen Programming 2 04-07-2006 10:44 AM
Using printk arunachalam Linux - Software 1 10-10-2005 03:07 PM
Regarding printk eshwar_ind Programming 0 11-23-2004 06:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:59 AM.

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
Open Source Consulting | Domain Registration