Re: printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 02, 2001 at 11:49:13AM -0500, Kevin Wojtysiak wrote:
> printk insists on dumping the kernel priority level WITH the message if a 
> newline isn't included in the printk string.
> 
> While trying to print out a list of bytes via a for loop of this type:
> for (loop through char [] 0 to i)
> {
> printk (KERN_INFO "char[i]");
> }
> printk("\n");
> 
> I end up with something like this: <6>1<6>1<6>0<6>1<6>1<6>1<6>0<6>1<6>1<6>0
> 
> Surely there must be some way to avoid this stupid behavior.

Of course:

	printk(KERN_INFO);

	for(loop through char [] 0 to i)
		printk("%d ", char[i]);

	printk("\n");

Or create a message with snprintf() and feed the buffer to printk().


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux