Hi All,
This is neto from Brazil
How are you?
Here you have a quick tutorial how to take and replay block traces.
1) Check for entries in /sys/kernel/debug. If it is empty, please do:
mount -t debugfs nodev /sys/kernel/debug
2) Generate some IO:
dd if=/dev/dm-13 of=/dev/null bs=65536 iflag=direct
3) Capturing the trace:
cd traces
blktrace /dev/dm-13
4) From another windows, please send kill -15 to blktrace PID
We can use either btreplay or fio to replay the traces. Be careful, that fio replay test does writes and it is destructive to the target device.
Example with btreplay:
1) Convert to replay files:
cd traces
btrecord -F
2) Replay the trace file
cd traces
btreplay -F -v -N /dev/dm-13If you want to remap to a different disk device, create a file called newdisk.txt (e.g. dm-13 dm-15) and use:
cd traces
btreplay -M newdisk.txt -F -v -N
Example with fio:
1) Converting traces to blkparse format:
blkparse -i /root/traces/dm-13.blktrace.0 -o /dev/null -d /root/traces/dm-13-fio-trace
2) Using fio to replay:
fio –name=replay –filename=/dev/dm-13 –direct=1 –read_iolog=/root/traces/dm-13-fio-trace –replay_no_stall=1 –replay_redirect=/dev/dm-13
I will keep doing more tests and will post more updates soon.
Thank you very much for reading.
All the best
neto
NetApp – I love this company!
Pingback: How to use blktrace, btrecord, btreplay - 2dd.it 2dd.it
Hi Neto,
While replaying the blktrace what is the data that is written ? is this the exact data written while blktrace was running , random data or a constant value (0,1..) ?
Eyal,
LikeLike
Hi Eyal,
This is neto from Brazil
How are you?
Good question. I will test it and I will let you know.
Thanks for following the blog.
All the best
neto
LikeLike