2009/1/5 siddhesh divekar <[email protected]>:
> Hi,
> I am adding some logs in the kernel code and want them to be written to some
> file.
> Can I achieve this using kprint ?
> How do I open a file in kernel mode,

Opening a file in kernel mode is not recommended, for security and
design philosophy reason. Even purely for debug tracing, it is not
good, because opening a file is too much disturbance to the real work
kernel is doing so may not get the accurate debugging information.
printk() does a good work because it merely stores the message in a
in-memory buffer (much cheaper than writing to a file directly), and
user-space Ksyslog will copy the content of the buffer to log files.

> also which time function should be used to get the current time in the logs.
>
> --
> Thank You,
> Siddhesh M. Divekar.
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to