2012年4月14日星期六

How to monitor the I/O of a specified application



I had found the following explanation from internet :

Quote :
To monitor the I/O activity for logical and physical volumes only, while controlling the monitored intervals using the trcon and trcoff commands, enter:

filemon -d -o fmon.out -O pv,lv

The filemon command automatically starts the system trace and puts itself  in the background. After this command, you can enter the unmonitored application programs and system commands to be run at this time, then enter:
trcon

After this command, you can enter the monitored application programs and system commands to be run at this time, then enter:
trcoff

After this command, you can enter the unmonitored application programs and system commands to be run at this time, then enter:

trcon

After this command, you can enter the monitored application programs and system commands to be run at this time, then enter:

trcstop

In this example, the -O flag is used to restrict monitoring to logical and physical volumes only. Only those trace events that are relevant to logical and physical volumes are enabled. Also, as a result of using the -d flag, monitoring is initially deferred until the trcon command is issued. System tracing can be intermittently disabled and reenabled using the trcoff and trcon commands, so that only specific intervals are monitored.

Example :
/usr/bin/filemon -o $LOG -O lf,lv,pv
sleep 10
trcstop

沒有留言: