kernel space logging
Hello all! I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running. Thanks for your time. cheers, -anand.
HI, kernel daemon is responsible for kernel messages and can be found here. http://linux.die.net/man/8/klogd Thanks Sanjeev Sharma On Tue, Mar 22, 2011 at 10:43 PM, Anand Arumugam <anand.arumug@gmail.com>wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Wed, Mar 23, 2011 at 5:42 AM, sanjeev sharma <sanjeevsharmaengg@gmail.com> wrote:
HI,
kernel daemon is responsible for kernel messages and can be found here.
http://linux.die.net/man/8/klogd
Thanks Sanjeev Sharma
On Tue, Mar 22, 2011 at 10:43 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Do you know where I can find the source code for the klogd in the kernel source tree?
On Fri, Mar 25, 2011 at 1:47 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
On Wed, Mar 23, 2011 at 5:42 AM, sanjeev sharma <sanjeevsharmaengg@gmail.com> wrote:
HI,
kernel daemon is responsible for kernel messages and can be found here.
http://linux.die.net/man/8/klogd
Thanks Sanjeev Sharma
On Tue, Mar 22, 2011 at 10:43 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Do you know where I can find the source code for the klogd in the kernel source tree?
klogd is userspace. It's not in the kernel source tree. Greg
On Tue, Mar 22, 2011 at 1:13 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Are you talking about the logs you see when you run dmesg? You are aware the kernel maintains a ring buffer that all printk's go into. Then there are API's that let userspace track the buffer and put the messages into on disk logs. dmesg just dumps out the ring buffer queue. The userspace API to the ring buffer is syslog(). So during bootup I _assume_ the kernel is just logging to the ring buffer, and then when the system is operational enough, userspace gets all the boot messages out of the kernel via syslog() and puts them to on disk log files. It's not too magic. Greg
On Thu, Mar 24, 2011 at 5:47 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Tue, Mar 22, 2011 at 1:13 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Are you talking about the logs you see when you run dmesg?
You are aware the kernel maintains a ring buffer that all printk's go into.
Then there are API's that let userspace track the buffer and put the messages into on disk logs.
dmesg just dumps out the ring buffer queue.
The userspace API to the ring buffer is syslog().
So during bootup I _assume_ the kernel is just logging to the ring buffer, and then when the system is operational enough, userspace gets all the boot messages out of the kernel via syslog() and puts them to on disk log files.
It's not too magic.
Greg
I was looking for the logging framework used by the kernel developers. Not just the dmesg logs.
On Fri, Mar 25, 2011 at 5:43 PM, Anand Arumugam <anand.arumug@gmail.com>wrote:
On Thu, Mar 24, 2011 at 5:47 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Tue, Mar 22, 2011 at 1:13 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Are you talking about the logs you see when you run dmesg?
You are aware the kernel maintains a ring buffer that all printk's go into.
Then there are API's that let userspace track the buffer and put the messages into on disk logs.
dmesg just dumps out the ring buffer queue.
The userspace API to the ring buffer is syslog().
So during bootup I _assume_ the kernel is just logging to the ring buffer, and then when the system is operational enough, userspace gets all the boot messages out of the kernel via syslog() and puts them to on disk log files.
It's not too magic.
Greg
I was looking for the logging framework used by the kernel developers. Not just the dmesg logs.
hope this helps: http://www.ibm.com/developerworks/linux/library/l-kernel-logging-apis/?ca=dr... this is a tool and good read otherwise: http://www.cs.huji.ac.il/~etsman/klogger/
On Fri, Mar 25, 2011 at 1:50 PM, Anuz Pratap Singh Tomar <chambilkethakur@gmail.com> wrote:
On Fri, Mar 25, 2011 at 5:43 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
On Thu, Mar 24, 2011 at 5:47 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Tue, Mar 22, 2011 at 1:13 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Are you talking about the logs you see when you run dmesg?
You are aware the kernel maintains a ring buffer that all printk's go into.
Then there are API's that let userspace track the buffer and put the messages into on disk logs.
dmesg just dumps out the ring buffer queue.
The userspace API to the ring buffer is syslog().
So during bootup I _assume_ the kernel is just logging to the ring buffer, and then when the system is operational enough, userspace gets all the boot messages out of the kernel via syslog() and puts them to on disk log files.
It's not too magic.
Greg
I was looking for the logging framework used by the kernel developers. Not just the dmesg logs.
hope this helps: http://www.ibm.com/developerworks/linux/library/l-kernel-logging-apis/?ca=dr...
this is a tool and good read otherwise:
@Greg-Freemyer and @Anuz: Thank you so much for the references and clarifications. cheers...
On Fri, Mar 25, 2011 at 1:43 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
On Thu, Mar 24, 2011 at 5:47 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Tue, Mar 22, 2011 at 1:13 PM, Anand Arumugam <anand.arumug@gmail.com> wrote:
Hello all!
I would like to know how logging is done while the kernel is booting up. More importantly I am looking for those files in the kernel source that handles the logging part. Also I would like to know what gets logged after the kernel is up and running.
Thanks for your time.
cheers, -anand.
Are you talking about the logs you see when you run dmesg?
You are aware the kernel maintains a ring buffer that all printk's go into.
Then there are API's that let userspace track the buffer and put the messages into on disk logs.
dmesg just dumps out the ring buffer queue.
The userspace API to the ring buffer is syslog().
So during bootup I _assume_ the kernel is just logging to the ring buffer, and then when the system is operational enough, userspace gets all the boot messages out of the kernel via syslog() and puts them to on disk log files.
It's not too magic.
Greg
I was looking for the logging framework used by the kernel developers. Not just the dmesg logs.
Most of its in kernel/printk.c and include/linux/printk.h If you mean the API for the framework, it is most easily seen in the .h file: http://lxr.linux.no/#linux+v2.6.38/include/linux/printk.h For the guts, see vprintk in particular: http://lxr.linux.no/#linux+v2.6.38/kernel/printk.c#L729 HTH Greg
participants (4)
-
Anand Arumugam -
Anuz Pratap Singh Tomar -
Greg Freemyer -
sanjeev sharma