Kernel logging
I am developing a kernel module using OpenSUSE 11.3(X86_64) Kernel 2.6.34.7-0.2 I am writing debug statements in my module and using a borrowed script below:
clear
echo
echo " ****************************************************"
echo " * NOTE: You must be superuser, logged in as root, *"
echo " * or have sufficient rights to kill/start *"
echo " * daemons and view log messages. This *"
echo " * script will not work, otherwise. *"
echo " ****************************************************"
echo
# Determine which log daemon is installed
SysLogd=syslogd
if [ -f /sbin/rsyslogd ]; then
SysLogd=rsyslogd
fi
# Stop kernel log daemon if running
if [ -f /var/run/klogd.pid ]; then
echo Stopping current klogd...
kill -s SIGTERM `cat /var/run/klogd.pid`
# Delay to let daemon halt
sleep 1
fi
# Stop current daemon if running
if [ -f /var/run/syslogd.pid ]; then
echo Stopping current ${SysLogd}...
kill -s SIGTERM `cat /var/run/syslogd.pid`
# Delay to let daemon halt
sleep 1
fi
# Start new daemon only if 'syslogd'
if [ "${SysLogd}" = "syslogd" ]; then
echo Starting new ${SysLogd}...
/sbin/${SysLogd}
fi
echo Starting log to console...
echo ">>>>>"
echo
cat /proc/kmsg
The problem I am seeing is that I get some good data, but mostly scrambled data. I really need to be able to see my printk statements clearly and consistently, is there a better method then the one above? I haven't done a lot of Linux kernel debugging, but I remember my last experience being a lot better then this when I debugged the hot plug module under fedora.
|