Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fincore: use madvise to report whether data file in buffer cache or not
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
fincore ======= A utility for determining whether a file is in the kernel's buffer cache. This simple program iterates over a list of files and calls mmap() and then mincore() for each disk block of a file. It reports whether the blocks are in the kernel's page buffer cache. This is a fully C implementation of David Plonka's fincore work, available at http://net.doit.wisc.edu/~plonka/fincore/ Quickstart ========== Let's look at a large file (i760User.pdf). 87% of this file is in the buffer cache. There are a total of 67770 pages. $ fincore i760User.pdf File Size Pages Percent i760User.pdf 67770 59167 0.87 Let's look at netstat-trace.txt and see WHICH pages (blocks) are in the buffer cache. See that the first 8 pages of the 162 block file are in core. $ fincore -v netstat-trace.txt File Size Pages Percent Details netstat-trace.txt 162 8 0.05 0 1 2 3 4 5 6 7 Let's get a report on all .txt files in the current directory to see what subset of them are in core. $ fincore -S *.txt Total files: 121 Total pages: 2344 Total in core:16 Building ======== The autotools are used for building the package. ./configure && make If you have an RPM-based system, you should also be able to build an RPM of the package straight from the tarball: rpmbuild -ta fincore-0.11.tar.gz Credits ======= The idea for this project derives from David Plonka's utility. Almost all of the code involved in the main loop of the program is unchanged from the Inline::C code used by the perl implementation. Martin A. Brown <email@example.com> - primary contact for this utility Dave Plonka <firstname.lastname@example.org> - perl implementation, using Inline::C Nathan Burnett <email@example.com> - unreleased prior work