Module Usage Documentation

 

Module Usage Documentation

INTRODUCTION
This module is developed in kernel 3.8.7. It has not been tested on other versions however it should work with recent versions.

If you can not get it fully worked, I am glad to help. You can contact me via email: sz12c@my.fsu.edu

Makefile
You need to do only one change in /driver/md/makefile, adding dm-statistic into dm-mod. If you are not sure how to do it, you can download my Makefile file in download page and replace the old one. Then go back to the kernel top directory and re-compile the kernel. Remember to compile the device mapper into modules.

dmsetup tool
This is a user space tool for configuration and it should be already in your system. If you don't have this, install it. If you are using Debian or Ubuntu, normally apt-get install will do this for you.

You need to have an unmounted partition to use dmsetup tool. If you have one, then you can use your dmsetup command in shell, using dm-statistic. If you don't how to do it, you can use the script in download page called dm-statistic.sh.

procfs
When you insert the dm-mod module, it will create two entries iunder /proc. One is jiffies which contains the value of HZ, base_time(in jiffies), current_time(in jiffies). The other is statistic which contains all the bios starting from base_time to now. User can read directly from these two files however a better way is to use the user program. You can find the user program in download page.

The statistic file may get really large after a long while running so if you want to read directly, it may take a long while to open it.

User program
This program is for reading and counting from the procfs file mentioned above. If you forget the usage, you can just type ./statistic and it will show the usage information. You can get the user program in download page and compile it with gcc.

./statistic [last x second]
: Show all the bios mapped during last x second from current time. Then print out the count of Total bio, Read bio and Write bio.

./statistic [from x second] [to y second]
: Show all the bios mapped during x second to y second from base time. Then print out the count of Total bio, Read bio and Write bio.

Remove
This command is used to remove the virtual device mapper device.

dmsetup remove /dev/mapper/statistic
It removes the virtual device. You need to get the root previledge.