console polling loop and inotify

William Cohen wcohen at redhat.com
Thu Mar 29 09:43:57 EDT 2007


I was running a simple script iotime.stp on the 314 build. The script monitors 
the reads and write performed by the systemt. When the process does the close it 
prints a summary: a time stamp in microseconds, pid, process name, type of 
information (number of accesses or amount of time), the file name. For accesses 
this is a "count" of the number of io operations follow by number of bytes read 
and writen. The time ones record the accumulated number of microseconds of wall 
clock time spent in read and write systemcalls for file by process.

When the machine was idle I saw the following entries come up again and again 
when the alt-0 console was open:


70943178 1916 (python) access /home/olpc/.sugar/default/logs count: 0 read: 0 
write: 0
70943410 1916 (python) access /home/olpc/.sugar/default/logs/shell.log count: 2 
read: 8474 write: 0
70943410 1916 (python) iotime /home/olpc/.sugar/default/logs/shell.log time: 24
70943681 1916 (python) access /home/olpc/.sugar/default/logs/presenceservice.log 
count: 2 read: 9052 write: 0
70943681 1916 (python) iotime /home/olpc/.sugar/default/logs/presenceservice.log 
time: 25
70943952 1916 (python) access /home/olpc/.sugar/default/logs/clipboard.log 
count: 2 read: 8227 write: 0
70943952 1916 (python) iotime /home/olpc/.sugar/default/logs/clipboard.log time: 24


Why poll? Doesn't python have access to inotify? It seems like something like 
that would be useful in a number of places to avoid having processes wake up, 
check that nothing has changed, and then go back to sleep.

-Will
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iotime.stp
URL: <http://lists.laptop.org/pipermail/devel/attachments/20070329/7cd5c6f5/attachment.ksh>


More information about the Devel mailing list