1 This directory contains some experimental work for capturing traces of
2 block device operations while filesystem operations are performed.
4 You can trace any operation that libguestfs supports, including
5 partitioning, mkfs, LVM operations, and filesystem operations. You
6 can enable and disable tracing in order to capture single operations
7 such as a single write, or groups of operations. You can examine the
8 traces by hand (as text files) or turn them into graphical
11 IMPORTANT NOTE: This is not upstream (in qemu) nor integrated into
12 libguestfs. We should probably be using the 'blktrace' command
13 instead, or if that is not suitable, get a more reliable and useful
14 trace mechanism added to qemu (the current patch is not suitable for
17 The *.qtr files are qemu trace files, produced using the unofficial
18 qemu patch in the current directory.
20 - guestfish-N-fs-10M.qtr
22 The command 'guestfish -N fs:ext2:10M' before we modified the
23 part-disk API to align the partition to 64 sectors.
25 - guestfish-N-fs-10M-aligned-part-disk.qtr
27 The command 'guestfish -N fs:ext2:10M' after we modified the
28 part-disk API to align the partition to 64 sectors.
30 - guestfish-add-mount.qtr
32 $ guestfish -a test1.img -m /dev/sda1
33 where test1.img was created by the previous command.
35 - guestfish-write-hello.qtr
37 $ guestfish -a test1.img -m /dev/sda1 \
38 debug qtrace "/dev/vda on" : \
39 write /hello "hello, world." : \
40 debug qtrace "/dev/vda off"
41 where test1.img was created by the command above.
43 This is just the creation of a new file with a small amount of content.
45 Within this trace file, the qtrace on/off commands appear as patterns
46 of reads. For on: 2, 21, 15, 2. For off: 2, 15, 21, 2.
48 - guestfish-lv-ext4-4k.qtr
51 alloc test1.img 40M : \
53 part-disk /dev/vda mbr : \
55 vgcreate VG /dev/vda : \
57 mkfs-opts ext4 /dev/VG/LV blocksize:4096
60 * an ext4 filesystem, so it has a journal and extents
61 * 4K block size, so we expect writes to be aligned
62 * located inside an LV, so more realistic
64 - guestfish-lv-ext4-4k-write-hello.qtr
66 $ guestfish -a test1.img -m /dev/VG/LV \
67 debug qtrace "/dev/vda on" : \
68 write /hello "hello, world." : \
69 debug qtrace "/dev/vda off"
70 where test1.img was created by the previous command.