Re: logging data to a file.

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

 



On Fri, Nov 04, 2005 at 14:43:47 +0100, Jesper Juhl wrote:
> On 11/4/05, Bahadir Balban <bilgehan.balban@xxxxxxxxx> wrote:
> > Hi,
> >
> > I want to log data, (mainly usb transactions) into a file from within
> > the kernel. The code writing to the file may well be running in
> > interrupt context, so it won't be associated with a process.
> 
> You really don't want to do file I/O from within the kernel.

I addition, you CAN'T do file I/O without process context. (because it
takes a semaphore, does allocation and other funny stuff that needs to
be able to sleep).

> > What is
> > the best way to achieve this?
> 
> Get the data to userspace via printk/sysfs/netlink or some such, then
> write the data to a file in userspace.

I suppose you meant to say procfs, not sysfs. Sysfs is a specific
way of accessing kobject properties. Procfs is much more general, so it
can be (ab)used for things like this.

--
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[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