summaryrefslogtreecommitdiffstats
path: root/analysis/loop/ftrace/README.md
blob: 6ac9cd7da53d7a0b57f7d844c7c42719aed30254 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

Tracing the loop device kernel module

The loop device kernel module can be traced with the ftrace framework of the Linux kernel. Therefore, ftrace must be compiled into the Linux kernel and the user space module trace-cmd is necessary.

Creating the trace file

Each loop device specific operation can be traced with the following command

trace-cmd record -p function_graph --module loop -o [trace file] [cmd]

where [trace file] is the created trace file and [cmd] is one of the following loop device operation: * add loop device: losetup -f test.img * read from loop device: dd if=/dev/loop0 bs=512 count=1 of=tmp.img * write to loop device: dd of=/dev/loop0 bs=512 count=1 if=tmp.img * remove loop device: losetup -D

Viewing the trace file

The created trace file can be viewed on the command line with the following command:

trace-cmd report -i [trace file]

where [trace file] is the already created trace file.