Because messages are processed through the ChorusOS operating system, drivers must never use sysLog or printf directly to display messages. The ChorusOS operating system provides the following macros to handle message logging:
DKI_MSG ((format, ...)) // typically does: printf DKI_WARN ((format, ...)) // typically does: printf + syslog DKI_PANIC((format, ...)) // typically does: printf + syslog + callDebug DKI_ERR((format, ... )) //typically does: printff + syslog
Moreover, message format conventions are as follows:
DKI_MSG -> "<name>: <message>" DKI_WARN -> "<name>: warning -- <message>" DKI_ERR -> "<name>: error -- <message>" DKI_PANIC -> "<name>: panic -- <message>"
where <name> is either:
the name of the driver (if the message is not related to a particular instance of the driver)
the path of the device in the device tree (if the message is related to a driver instance)
The dtreePathLeng() and dtreePathGet() calls can be used to get the device tree path for a particular instance.