Hi, ashutosh tiwari wrote: > Hi All, > > I need some help and pointers regarding driver programming on > solaris 10 kernel. > > I have a module that has been ported in the kernel space. And I > have changed all > the printfs to cmn_err as the simplest logging mechanism and it > prints the messages in /var/adm/messages. I have three queries: > 1) Due to bug, system panics in some code leg. However, all the prints by > that time are not visible in the /var/adm/messages log. Most likely, the > kernel panics before all the prints have a chance to be copied to the > messages file. This creates a problem because prints do not correctly > represent the amount of code that was successfully executed and hence > debugging becomes difficult. Is there a way that could cause ?flushing? of > messages to the /var/adm/messages file? > 2) In case ?flushing? is not possible, is there a way to read the > remaining message buffer from the crash file generated on reboot? Can it be > viewed using mdb crash analysis? > I assume the dump is in /var/crash/hostname where hostname is the name of your machine. Also, the dump file will end in a number, eg. unix.0 vmcore.0, unix.1 vmcore.1, etc.
# cd /var/crash/hostname # mdb 0 <-- if dump is unix.0, vmcore.0 > ::msgbuf <-- this will show you the message buffer where your cmn_err output should be found. > 3) While debugging a ?bad stack overflow? condition, I found that if I > disabled all the prints, system did not panic and the ?bad stack overflow? > did not occur. Does anybody know if too many cmn_err prints can cause kernel > panic? > No, this should not happen. I suspect you have a bug in the way an argument is being passed to one of your cmn_err calls. Good luck. max > > Any pointers to manuals/articles or other material will be greatly > appreciated. I am ready to RTFM if only somebody would point to it. > > Thanks in advance, > Ashutosh >