COHERENT manpages
This page displays the COHERENT manpage for tr [Driver to read stored error messages].
List of available manpages
Index
tr -- Device Driver
Driver to read stored error messages
/dev/trace
The device driver tr is the ``traceback'' driver for the COHERENT kernel.
It manipulates an internal buffer that holds error messages from the kernel
or another device driver. It has major number 6. This driver is extremely
useful to persons who are writing device drivers.
The DDI/DKI kernel routine cmn_err() can be invoked by drivers to write
formatted messages. By default, it writes the messages both onto the
system's console and into an internal buffer in memory that can hold up to
four megabytes of text. Messages that begin with a caret, `^', go to the
console but not the internal buffer. Messages that begin with an
exclamation point, `!', go to the buffer but not to the console.
The trace driver tr reads this internal buffer, and lets you copy its
contents into a file for later perusal. This offers two major advantages
to persons developing and debugging device drivers:
-> First, copious diagnostic output will no longer scroll off the screen
and be lost. The trace buffer holds every error message written through
cmn_err() until you read the buffer. When you install tr, you can set
the size of the buffer, up to four megabytes.
-> Second, if messages are written to the trace buffer only and not to the
console, system timing is affected much less than if the messages were
written to the console. This makes it easier to catch subtle problems
in timing.
To add tr to your kernel, do the following:
-> Log in as the superuser root.
-> cd to directory /etc/conf.
-> Execute script tr/mkdev. This will walk you through the process of
configuring your kernel to use this driver, and create the device
/dev/trace.
-> Execute script bin/idmkcoh, to generate a new kernel.
-> Invoke the script /etc/shutdown to shutdown system, then boot the new
kernel.
To read the contents of the trace buffer, simply use the command
cp /dev/trace file
where file is the file into which you wish to copy the contents of the
trace buffer.
See Also
device drivers
COHERENT Device Driver Kit:
cmn_err()