Giter Site home page Giter Site logo

npanuhin / edu-dmp-stats-module Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11 KB

Educational project about the Device Mapper Proxy (dmp) Module with statistics

License: MIT License

Makefile 2.41% C 76.02% Shell 21.57%
device-mapper kernel-module linux-kernel

edu-dmp-stats-module's Introduction

Device Mapper Proxy (dmp) module with statistics

Device Mapper Proxy (dmp) is a kernel module for the Linux operating system that creates virtual block devices on top of existing devices using the device mapper framework. The module also monitors and provides statistics on the performed operations, which are accessible through the sysfs interface.

Remarks

I used Ubuntu 22.04.3 LTS with the 5.15.0-92-generic kernel for building and testing the module

Installation

Clone the repository:

git clone https://github.com/npanuhin/edu-dmp-stats-module

Building and Testing

To build and intially test the module, run run.sh. It will give a nice summary of the operations performed and will run a simple test to check the module's functionality.

sh ./run.sh
Click to see the output
=============================================== Updating the code ===============================================
Removing .Module.symvers.cmd
Removing .dmp.ko.cmd
Removing .dmp.mod.cmd
Removing .dmp.mod.o.cmd
Removing .dmp.o.cmd
Removing .modules.order.cmd
Removing Module.symvers
Removing dmp.ko
Removing dmp.mod
Removing dmp.mod.c
Removing dmp.mod.o
Removing dmp.o
Removing modules.order
Already up to date.

=============== Removing previously inserted module, zero device and device-mapper proxy device ===============

============================================== Building the module =============================================
make -C /lib/modules/5.15.0-92-generic/build M=/home/npanuhin/tools/edu-dm-proxy-stats-module modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-92-generic'
  CC [M]  /home/npanuhin/tools/edu-dm-proxy-stats-module/dmp.o
  MODPOST /home/npanuhin/tools/edu-dm-proxy-stats-module/Module.symvers
  CC [M]  /home/npanuhin/tools/edu-dm-proxy-stats-module/dmp.mod.o
  LD [M]  /home/npanuhin/tools/edu-dm-proxy-stats-module/dmp.ko
  BTF [M] /home/npanuhin/tools/edu-dm-proxy-stats-module/dmp.ko
Skipping BTF generation for /home/npanuhin/tools/edu-dm-proxy-stats-module/dmp.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-92-generic'

=============================================== Creating devices ==============================================
crw------- 1 root root 10, 236 фев  9 00:10 /dev/mapper/control
lrwxrwxrwx 1 root root       7 фев  9 00:17 /dev/mapper/zero1 -> ../dm-0
crw------- 1 root root 10, 236 фев  9 00:10 /dev/mapper/control
lrwxrwxrwx 1 root root       7 фев  9 00:17 /dev/mapper/dmp1 -> ../dm-1
lrwxrwxrwx 1 root root       7 фев  9 00:17 /dev/mapper/zero1 -> ../dm-0

============================================== Testing the module =============================================
1+0 records in
1+0 records out
4096 bytes (4,1 kB, 4,0 KiB) copied, 0,00151003 s, 2,7 MB/s
1+0 records in
1+0 records out
4096 bytes (4,1 kB, 4,0 KiB) copied, 0,000888471 s, 4,6 MB/s

=============================================== Module statistics =============================================
read:
  reqs: 2286
  avg size: 1004
write:
  reqs: 8
  avg size: 512
total:
  reqs: 2294
  avg size: 1003

Further Usage

  • To reset the statistics, run:

     echo > /sys/module/dmp/stat/volumes
  • To view the statistics, run:

     cat /sys/module/dmp/stat/volumes
    Click to see the sample output
     read:
       reqs: 83
       avg size: 1875
     write:
       reqs: 0
       avg size: 0
     total:
       reqs: 83
       avg size: 1875

edu-dmp-stats-module's People

Contributors

npanuhin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.