Re: How to locate struct file * from a bio?




On Jan 31 2007 16:18, Helge Hafting wrote:
Eddie Pettis wrote:
Longer version: I am working on a project that requires measuring the
popularity of each file in a filesystem. I have made several attempts
to locate all the file reads by grepping for ->readpage() and
->readpages() calls, but I am still missing several file reads. I
have not yet looked for file writes.

Why don't you tap into "open" instead?
Here you can note who opens the file and if they open it for
reading or writing. If you really need the amount of data
transferred, consider trapping the read and write syscalls too.

And to add the sugar on top: in case you can live without tracing / (root
filesystem), you can write your very own fuse filesystem layer in a few
minutes and trace every small thing. Or perhaps take an existing project
(aufs/unionfs) and enhance the module with some the wanted hooks, etc.


Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Netbeans query
    ... I don't know what the "Select from Favorites" command is all about, ... Plus "Favorites" opens up this whole window. ... want to stay inside the IDE instead of flipping to a file browser, ... operation of "mount a filesystem" in the current Netbeans. ...
    (comp.lang.java.programmer)
  • Re: [RFC] O_NOACC: open without any access
    ... Unless you really insist on unlimited use of ioctlon such beasts (and ... If we want full-blown ->ioctlcoming from the fs code on such opens, ... the normal one in case of normal open), but it's more boilerplate patches ... At least add a filesystem flag: ...
    (Linux-Kernel)
  • Re: [RFC] atomic create+open
    ... > opens for NFSv4. ... filesystem sets ... > It is non-portable and it was never supported on NFSv4 anyway. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Many open/close on same files yeilds "No such file or directory".
    ... When a program opens and closes ... Test program that can reproduce the problem on my setup: ... 4.5TB ext3 filesystem on an LVM volume. ... It may just be a hardware problem, ...
    (Linux-Kernel)
  • Many open/close on same files yeilds "No such file or directory".
    ... When a program opens and closes ... 4.5TB ext3 filesystem on an LVM volume. ... I cannot reproduce it on other disks attached to the same server or on ... 05:08.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI ...
    (Linux-Kernel)