Re: printing logs in kernel mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/1/5 siddhesh divekar <siddhesh.divekar@xxxxxxxxx>:
> 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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux