Re: logging data to a file.

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

 



On Fri, Nov 04, 2005 at 10:44:47AM -0800, Tim Bird wrote:
> Greg KH wrote:
> > On Fri, Nov 04, 2005 at 09:34:20AM -0800, Tim Bird wrote:
> > 
> >>I have trace data that I export to user space via procfs, using
> >>seq_file operations.  I copied this technique from Ingo Molnar's
> >>code to trace preemption issues, and it has been working well
> >>for my tracing system.
> >>
> >>Patches are available at:
> >>http://tree.celinuxforum.org/CelfPubWiki/KernelFunctionTrace
> >>(follow the link under Downloads to the CELF patch archive,
> >>and look for kft-all-in-one-2.6.12.patch.  Sorry, patches
> >>for later kernels are not available yet.)
> > 
> > For later kernels, you should use relayfs, as this is exactly what it
> > was made for.  Hm, I think there is a trace patch for this exact reason
> > that uses relayfs too :)
> >
> I've been waiting for relayfs to stabilize and get mainlined.
> Now that it has, I'll take a look at it again.
> One thing that didn't work for me before was that it ONLY
> supported per-cpu buffering.  I prefer a single buffer
> (I know it causes cache thrashing, but I have my reasons).
> Also, having to mount it is really a pain.

If relayfs doesn't work for you (and I do agree that it does have some
odd attributes at times), then just use debugfs instead of procfs.  You
can use your same seqfile interface, so it should be a very small change
to your code.

> As an aside, what trace patch that uses relayfs
> are you referring - an updated LTT or something else?
> There appear to be no in-kernel users of relayfs
> to use for an example.

Yes, I was referring to LTT, it has used relayfs for quite some time
now.  But as you know, LTT has other issues...

If you have any questions about debugfs, please let me know.  It's quite
easy to just add a single line to /etc/fstab to always mount the thing,
so you can't use that as an excuse :)

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