Saturday, November 17, 2007

KTR log support implementation in FreeBSD

How can you monitor/log changes you make inside the FreeBSD Kernel?

The KTR support is provided by FreeBSD for tracing the logs that come from the kernel during
its execution.
The following lines must be added to the /usr/src/sys/i386/conf/MYKERNEL file to support
the KTR logs.
options KTR
options KTR_COMPILE=(KTR_MYLOG|KTR_PROC)
options KTR_CPUMASK=0xff
options KTR_ENTRIES=8192
options KTR_MASK=(KTR_MYLOG|KTR_PROC)
To see the logs following command can be used after logging on to the system or any
time during the user processes are run.
sysctl debug.ktr.cpumask=0
ktrdump –o > mylog.log
The file can be viewed using vi mylog.log


use
#man ktr for more information..

vaibhav

No comments: