linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Printk output on console
@ 2004-12-21  9:24 srinivas naga vutukuri
  2004-12-21  9:43 ` selvakumar nagendran
  0 siblings, 1 reply; 6+ messages in thread
From: srinivas naga vutukuri @ 2004-12-21  9:24 UTC (permalink / raw)
  To: linux-kernel

Hi Selva,
 
 I understood the question as where all/what all printks (with
 line nos and the file names)
 you are looking for is it. I think, in a normal printf  using the
 macros __FILE__ and __LINE__ will give that...
 
 ex:
 printk(KERN_ERR "%s: Driver Initialisation failed", __FILE__);
 Is this helpful...
 
Regards,
srinivas.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printk output on console
  2004-12-21  9:24 Printk output on console srinivas naga vutukuri
@ 2004-12-21  9:43 ` selvakumar nagendran
  2004-12-21 16:19   ` srinivas naga vutukuri
  2004-12-23 11:04   ` Luca Falavigna
  0 siblings, 2 replies; 6+ messages in thread
From: selvakumar nagendran @ 2004-12-21  9:43 UTC (permalink / raw)
  To: srinivas naga vutukuri; +Cc: linux-kernel

Hi srinivas,
     My question is "We are having lot more printk
statements in the kernel source files. While the
kernel is in execution where the output of all these
statements will go? and can we redirect the output of
printk to our console?
     Please help me. Also I have one more error after
having compiled my new kernel 2.6.9. After booting it
shows the following error

"Kernel panic syncing unable to mount block(0,0) VFS
specify root =LABEL correctly"
  Do u know how to deal with it?

Thanks,
selva
--- srinivas naga vutukuri
<srinivas.vutukuri@gmail.com> wrote:

> Hi Selva,
>  
>  I understood the question as where all/what all
> printks (with
>  line nos and the file names)
>  you are looking for is it. I think, in a normal
> printf  using the
>  macros __FILE__ and __LINE__ will give that...
>  
>  ex:
>  printk(KERN_ERR "%s: Driver Initialisation failed",
> __FILE__);
>  Is this helpful...
>  
> Regards,
> srinivas.
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 



		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printk output on console
  2004-12-21  9:43 ` selvakumar nagendran
@ 2004-12-21 16:19   ` srinivas naga vutukuri
  2004-12-23 11:04   ` Luca Falavigna
  1 sibling, 0 replies; 6+ messages in thread
From: srinivas naga vutukuri @ 2004-12-21 16:19 UTC (permalink / raw)
  To: selvakumar nagendran; +Cc: linux-kernel

Hi Selva,

You can go through, one of the help link on the log msgs...
     http://www.hk8.org/old_web/linux/run/ch08_03.htm
I think, they(kernel printk's) are directing to the console only...
Or you can observe, initially while booting it up, after console initiation
happened, it starts buffering out all the printk's output to the console
only.

But i did't remember, the code flow, at a particular point, the X or
something
the shell will take over of it...But any emergency msgs, from the kernel,
will be
coming onto the Console only...

I think, for your error msg, you can better google it...Its not able to
recognise,
the boot partition may be...

Regards,
srinivas.



----- Original Message -----
From: "selvakumar nagendran" <kernelselva@yahoo.com>
To: "srinivas naga vutukuri" <srinivas.vutukuri@gmail.com>
Cc: <linux-kernel@vger.kernel.org>
Sent: Tuesday, December 21, 2004 3:13 PM
Subject: Re: Printk output on console


> Hi srinivas,
>      My question is "We are having lot more printk
> statements in the kernel source files. While the
> kernel is in execution where the output of all these
> statements will go? and can we redirect the output of
> printk to our console?
>      Please help me. Also I have one more error after
> having compiled my new kernel 2.6.9. After booting it
> shows the following error
>
> "Kernel panic syncing unable to mount block(0,0) VFS
> specify root =LABEL correctly"
>   Do u know how to deal with it?
>
> Thanks,
> selva
> --- srinivas naga vutukuri
> <srinivas.vutukuri@gmail.com> wrote:
>
> > Hi Selva,
> >
> >  I understood the question as where all/what all
> > printks (with
> >  line nos and the file names)
> >  you are looking for is it. I think, in a normal
> > printf  using the
> >  macros __FILE__ and __LINE__ will give that...
> >
> >  ex:
> >  printk(KERN_ERR "%s: Driver Initialisation failed",
> > __FILE__);
> >  Is this helpful...
> >
> > Regards,
> > srinivas.
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
> http://promotions.yahoo.com/new_mail


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printk output on console
  2004-12-21  9:43 ` selvakumar nagendran
  2004-12-21 16:19   ` srinivas naga vutukuri
@ 2004-12-23 11:04   ` Luca Falavigna
  1 sibling, 0 replies; 6+ messages in thread
From: Luca Falavigna @ 2004-12-23 11:04 UTC (permalink / raw)
  To: selvakumar nagendran; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Selvakumar,
| While the
|> kernel is in execution where the output of all these
|> statements will go?

printk messages go to /proc/kmsg. You can read them using cat (e.g. cat
/proc/kmsg)
| can we redirect the output of
|> printk to our console?

There is another way to display kernel messages on a console: managing
ttys. Here is some code (taken from Peter Salzman's "The Linux Kernel
Module Programming Guide"):

static void print_string(char *str)
{
	struct tty_struct *tty;

#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,5) )
	tty = current->tty;
#else
	tty = current->signal->tty;
#endif

	if (!tty)
		return;

	((my_tty->driver)->write) (my_tty, 0, str, strlen(str));
	((my_tty->driver)->write) (my_tty, 0, "\015\012", 2);

}

Regards,

					Luca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQcqmKxZrwl7j21nOAQKKegf/ZvQxx4FlaObzfeRQYXr5rRyK3/CSwaMX
3vFxX4fGm1Bn0PkTM1NgmgGnDdWaRFyME4odSy6k5XjnyPwO1DqkDUqJarexaq2V
8wrFhQMe3duEhgxonhOSVn/n+/ZIkqxkLujgk5YNpI8jE2vgzw9SwgGb5ck4wEz3
KbqF7YDRPnPot2rud3RTVVzc1MOb0Ti0zDRMpmvyOxkjOL1eocYKJfo5ZalNBQZi
k6B7Akk4zWZ6iFjl2Ojxw4RrZVoUupPb2qbkGWp11ghStTur1Qpw5WJyQ25zQB40
8r8ERFfzE02dbE/jiUj5SucJ8DVIKY38KXcMTS64+vWtH9263GkuxQ==
=1DIB
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Printk output on console
  2004-12-21  6:32 selvakumar nagendran
@ 2004-12-27 10:34 ` Robin Jose
  0 siblings, 0 replies; 6+ messages in thread
From: Robin Jose @ 2004-12-27 10:34 UTC (permalink / raw)
  To: selvakumar nagendran; +Cc: linux kernel mailing list

You can refer to Rubini's book "Linux Device Drivers 2nd Edition". See
section "How messages gets logged" in Chapter 4, which explains in
detail how to use printk for debugging.

This book is now available online, under Oreilly's open book project
http://www.xml.com/ldd/chapter/book/ch04.html

Thanks,
Robin

On Mon, 20 Dec 2004 22:32:22 -0800 (PST), selvakumar nagendran
<kernelselva@yahoo.com> wrote:
> How can we see the output of printk calls in kernel
> source files in our console. Is there any special
> command or utility for it?
> How to view the output of printk on our console? What
> is the log level to be set for this?
> 
> Thanks,
> selva
> 
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Printk output on console
@ 2004-12-21  6:32 selvakumar nagendran
  2004-12-27 10:34 ` Robin Jose
  0 siblings, 1 reply; 6+ messages in thread
From: selvakumar nagendran @ 2004-12-21  6:32 UTC (permalink / raw)
  To: linux kernel mailing list

 How can we see the output of printk calls in kernel
source files in our console. Is there any special
command or utility for it?
 How to view the output of printk on our console? What
is the log level to be set for this?

Thanks,
selva



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-12-27 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21  9:24 Printk output on console srinivas naga vutukuri
2004-12-21  9:43 ` selvakumar nagendran
2004-12-21 16:19   ` srinivas naga vutukuri
2004-12-23 11:04   ` Luca Falavigna
  -- strict thread matches above, loose matches on Subject: below --
2004-12-21  6:32 selvakumar nagendran
2004-12-27 10:34 ` Robin Jose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).