Re: logging data to a file.

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

 



On Fri, Nov 04, 2005 at 03:03:24PM +0100, Jesper Juhl wrote:
> On 11/4/05, Thomas Petazzoni <thomas.petazzoni@xxxxxxxx> wrote:
> > Hi,
> >
> > Jesper Juhl wrote:
> >
> > > Get the data to userspace via printk/sysfs/netlink or some such, then
> > > write the data to a file in userspace.
> >
> > I don't think sysfs is designed to transfer data from the kernel to
> > userspace applications, it's dedicated to exporting attributes of
> > devices to userspace.
> >
> That's right, but it can be perverted to export other data as well...

And if you do that, large birds will swoop down out of the sky and peck
at your ears until you delete that code.

> Not what it's intended for, but if you just need to get some data out
> while debugging it can work for that purpose.

That's _exactly_ what debugfs is for.  Use that, or relayfs (you can use
relayfs within debugfs too) for this.

> > Concerning Netlink, as far as I know the number of communication
> > channels is limited, and one can create its own simply (that's why the
> > Netfilter guys introduced nf_netlink, which multiplexes the
> > Netfilter-reserved Netlink socket). Am I wrong ?
> >
> According to the docs I've read "Each netlink family has a set of 32
> multicast groups." so yeah, you are right, there's a limit. But it
> still might be suitable for what Bahadir has in mind.

See the connector code, which makes using this easier.

thanks,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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