Usage 1)
blktrace /dev/sda /dev/sdc &
kill -15 pid
blkparse sda sdc > events
less events
Usage 2)
화면에서 실시간 확인시
blktrace [블록장치경로] -a complete -o - | blkparse -f “%d,%S,%n\n” -i -
Usage 3)
파일로 저장시
blktrace [블록장치경로] -a complete
blkparse -f “%d,%S,%n\n”-i [tracefile] > test.csv
-f Output format. Customize the output format. The format field
identifiers are:
%a - Action
%c - CPU ID
%C - Task command (process) name
%d - Direction (r/w)
%D - Device number
%e - Error number
%M - Major
%m - Minor
%N - Number of bytes
%n - Number of sectors
%p - PID
%P - PDU
%s - Sequence number
%S - Sector number
%t - Time (wallclock - nanoseconds)
%T - Time (wallclock - seconds)
%u - Time (processing - microseconds)
%U - Unplug depth
identifiers are:
%a - Action
%c - CPU ID
%C - Task command (process) name
%d - Direction (r/w)
%D - Device number
%e - Error number
%M - Major
%m - Minor
%N - Number of bytes
%n - Number of sectors
%p - PID
%P - PDU
%s - Sequence number
%S - Sector number
%t - Time (wallclock - nanoseconds)
%T - Time (wallclock - seconds)
%u - Time (processing - microseconds)
%U - Unplug depth
Default Output
The standard header (or initial fields displayed) include:
"%D %2c %8s %5T.%9t %5p %2a %3d"
Breaking this down:
- %D
- Displays the event's device major/minor as: %3d,%-3d.
- %2c
- CPU ID (2-character field).
- %8s
- Sequence number
- %5T.%9t
- 5-character field for the seconds portion of the time stamp and a 9-character field for the nanoseconds in the time stamp.
- %5p
- 5-character field for the process ID.
- %2a
- 2-character field for one of the actions.
- %3d
- 3-character field for the RWBS data.
Seeing this in action:
8,0 3 1 0.000000000 697 G W 223490 + 8 [kjournald]
The header is the data in this line up to the 223490 (starting block). The default output for all event types includes this header.
$ blktrace -d /dev/sda -o - | blkparse -i - |
위와 같은 에러를 내면서 blktrace가 동작하지 않는다면,
아래와 같이 해 준다.
$ mount -t debugfs debugfs /sys/kernel/debug |
To launch automatically,
put this into /etc/fstab
debug /sys/kernel/debug debugfs default 0 0
출처 : http://blog.naver.com/PostView.nhn?blogId=go4real&logNo=89718340&redirect=Dlog&widgetTypeCall=true
'Embedded Lab > linux, x86' 카테고리의 다른 글
[blktrace 포맷을 disksim 포맷으로] (0) | 2013.04.08 |
---|---|
[blktrace 설치법] (0) | 2013.04.08 |
[blktrace2] (0) | 2013.04.08 |
[blktrace1] (0) | 2013.04.08 |
[printk 로그 레벨] (0) | 2013.04.08 |