diff options
author | Manuel Bentele | 2019-06-05 01:24:20 +0200 |
---|---|---|
committer | Manuel Bentele | 2019-06-05 14:29:33 +0200 |
commit | f1cb688da5687fd7cec704af1d38058368525ca4 (patch) | |
tree | 71bf6e00ffe99c5aa4b0601fad35b300323860c1 /analysis/loop/ftrace/README.md | |
parent | Regenerated call graphs with pycflow2dot (diff) | |
download | kernel-qcow2-f1cb688da5687fd7cec704af1d38058368525ca4.tar.gz kernel-qcow2-f1cb688da5687fd7cec704af1d38058368525ca4.tar.xz kernel-qcow2-f1cb688da5687fd7cec704af1d38058368525ca4.zip |
Added function traces of the loop device kernel module
Diffstat (limited to 'analysis/loop/ftrace/README.md')
-rw-r--r-- | analysis/loop/ftrace/README.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/analysis/loop/ftrace/README.md b/analysis/loop/ftrace/README.md new file mode 100644 index 0000000..6ac9cd7 --- /dev/null +++ b/analysis/loop/ftrace/README.md @@ -0,0 +1,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 +```bash +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: +```bash +trace-cmd report -i [trace file] +``` +where `[trace file]` is the already created trace file. |