Discrepancy between ps -i -o inblk and figuring numbers by hand

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Mar 24 22:47:43 PST 2005


On 2005-03-24 19:53, Jonathan Stewart <jonstew1983 at yahoo.com> wrote:
>--- Dan Nelson <dnelson at allantgroup.com> wrote:
>>In the last episode (Mar 24), Jonathan Stewart said:
>>> In that case how would I track how much information a process has
>>> actually read from a drive?  I occasionally run processes that
>>> will read as much as 40+ gig in a single run which takes quite a
>>> while and on windows :P I can see "bytes read" and "bytes written"
>>> per process which lets me track how much the program has read so
>>> far and thus get an idea of how close it is to done.  Sorry for
>>> the run-on sentence there.
>>
>> I use lsof, which can tell you the file offset of each open
>> filedescriptor.  "lsof -o -o20 -p ###" will print all the files
>> currently opened by pid ###, and their current offset.
>
> Hmm, that almost works but the program opens 1000's of files each
> time.  The program is Unison which is a file synchronizer and I have
> it synchronizing files sets >40GB with and 1000's or more files.
> Based on your description once the file is closed I can't even tell if
> it was read or not :P

So, what you are looking for is a single byte count that increases
sequentially for all read() and write() system calls?



More information about the freebsd-questions mailing list