man > dmstats(8)

DMSTATS(8)                                                                                                                                                                                                                                                                 MAINTENANCE COMMANDS                                                                                                                                         DMSTATS(8)

๐Ÿ“‹ NAME

dmstats โ€” device-mapper statistics management

๐Ÿš€ Quick Reference

Use CaseCommandDescription
Create a whole-device regiondmstats create <device>Creates a new statistics region spanning the entire device.
Create a region with specific size and offsetdmstats create --start <start> --length <len> <device>Places a region of arbitrary length at an arbitrary offset.
Create a region with multiple areasdmstats create --areas <nr> <device>Divides the region into the specified number of equal-sized areas.
Create regions per segmentdmstats create --segments <device>Creates a separate region for each target in the device table.
Create file-mapped regionsdmstats create --filemap <file>Creates regions corresponding to the on-disk extents of a file.
List regionsdmstats list <device>Lists statistics regions, areas, or groups on the device.
Report statisticsdmstats report <device>Displays a continuous or one-shot report of counter values.
Print raw countersdmstats print --regionid <id> <device>Prints raw kernel counters for a specific region.
Delete all regionsdmstats delete --alldevices --allregionsRemoves all regions from all devices.
Group regionsdmstats group --regions <list> <device>Combines regions into a group for aggregated reporting.

๐Ÿ” SYNOPSIS

dmsetup stats <command> [OPTIONS]

dmstats <command> <device_name> | --major <major> --minor <minor> | -u|--uuid <uuid> [-v|--verbose]
dmstats clear <device_name> [--allprograms|--programid <id>] [--allregions|--regionid <id>]
dmstats create <device_name...>|<file_path...>|--alldevices [--areas <nr_areas>|--areasize <area_size>] [--bounds <histogram_boundaries>] [--filemap] [--follow <follow_mode>] [--foreground] [--nomonitor] [--nogroup] [--precise] [--start <start_sector> --length <length>|--segments] [--userdata <user_data>] [--programid <id>]
dmstats delete <device_name>|--alldevices [--allprograms|--programid <id>] [--allregions|--regionid <id>]
dmstats group [<device_name>|--alldevices] [--alias <name>] [--regions <regions>]
dmstats help [-c|-C|--columns]
dmstats list [<device_name>] [--histogram] [--allprograms|--programid <id>] [--units <units>] [--area] [--region] [--group] [--nosuffix] [--notimesuffix] [-v|--verbose]
dmstats print [<device_name>] [--clear] [--allprograms|--programid <id>] [--allregions|--regionid <id>]
dmstats report [<device_name>] [--interval <seconds>] [--count <count>] [--units <units>] [--histogram] [--allprograms|--programid <id>] [--allregions|--regionid <id>] [--area] [--region] [--group] [-O|--sort <sort_fields>] [-S|--select <selection>] [--units <units>] [--nosuffix] [--notimesuffix]
dmstats ungroup [<device_name>|--alldevices] [--groupid <id>]
dmstats update_filemap <file_path> [--groupid <id>] [--follow <follow_mode>] [--foreground]

๐Ÿ“ DESCRIPTION

The dmstats program manages IO statistics regions for devices that use the device-mapper driver. Statistics regions may be created, deleted, listed and reported on using the tool.

The first argument to dmstats is a command.

The second argument is the device name, uuid or major and minor numbers.

Further options permit the selection of regions, output format control, and reporting behaviour.

When no device argument is given dmstats will by default operate on all device-mapper devices present. The create and delete commands require the use of --alldevices when used in this way.

โš™๏ธ OPTIONS

๐Ÿ“‚ COMMANDS

๐Ÿงน clear

dmstats clear <device_name> [--allprograms|--programid <id>] [--allregions|--regionid <id>]

Instructs the kernel to clear statistics counters for the specified regions (with the exception of in-flight IO counters).

๐Ÿ†• create

dmstats create <device_name...>|<file_path...>|--alldevices [--areas <nr_areas>|--areasize <area_size>] [--bounds <histogram_boundaries>] [--filemap] [--follow <follow_mode>] [--foreground] [--nomonitor] [--nogroup] [--precise] [--start <start_sector> --length <length>|--segments] [--userdata <user_data>] [--programid <id>]

Creates one or more new statistics regions on the specified device(s). The region will span the entire device unless --start and --length or --segments are given. If --precise is used, the command will attempt to create a region using nanosecond precision counters. If --bounds is given a latency histogram will be tracked. Latency values are given in nanoseconds. An optional program_id or user_data string may be associated. If --filemap is given with a regular file, regions are created corresponding to the physical extents allocated to the file.

๐Ÿ—‘๏ธ delete

dmstats delete <device_name>|--alldevices [--allprograms|--programid <id>] [--allregions|--regionid <id>]

Delete the specified statistics region. All counters and resources are released. Use --allregions to remove all regions on a device. To remove all regions on all devices use both --allregions and --alldevices. If a --groupid is given, the group and all its regions are deleted.

๐Ÿ”— group

dmstats group [<device_name>|--alldevices] [--alias <name>] [--regions <regions>]

Combine one or more statistics regions on the specified device into a group. The list of regions is specified with --regions and an optional alias with --alias. Regions with histograms can be grouped only if the histogram bins match exactly.

โ“ help

dmstats help [-c|-C|--columns]

Outputs a summary of the commands available, optionally including the list of report fields.

๐Ÿ“‹ list

dmstats list [<device_name>] [--histogram] [--allprograms|--programid <id>] [--units <units>] [--area] [--region] [--group] [--nosuffix] [--notimesuffix] [-v|--verbose]

List the statistics regions, areas, or groups registered on the device. By default only regions and groups are included. Use -v for verbose output including areas. Use --histogram to include bin count and latency boundary values.

๐Ÿ–จ๏ธ print

dmstats print [<device_name>] [--clear] [--allprograms|--programid <id>] [--allregions|--regionid <id>]

Print raw statistics counters for the specified region or for all present regions.

๐Ÿ“Š report

dmstats report [<device_name>] [--interval <seconds>] [--count <count>] [--units <units>] [--histogram] [--allprograms|--programid <id>] [--allregions|--regionid <id>] [--area] [--region] [--group] [-O|--sort <sort_fields>] [-S|--select <selection>] [--units <units>] [--nosuffix] [--notimesuffix]

Start a report for the specified object or for all present objects. The report can repeat at a fixed interval. Use --histogram to include histogram values. Use --relative to show bin values as percentages. Object types (areas, regions, groups) are selected using --area, --region, and --group.

๐Ÿ”“ ungroup

dmstats ungroup [<device_name>|--alldevices] [--groupid <id>]

Remove an existing group and return all the group's regions to their original state. The group is specified using --groupid.

๐Ÿ”„ update_filemap

dmstats update_filemap <file_path> [--groupid <id>] [--follow <follow_mode>] [--foreground]

Update a group of dmstats regions specified by group_id, that were previously created with --filemap. This will add and remove regions to reflect changes in the allocated extents of the file. Use --nomonitor to force a direct update and disable starting the monitoring daemon.

๐Ÿท๏ธ REGIONS, AREAS, AND GROUPS

The device-mapper statistics facility allows separate performance counters to be maintained for arbitrary regions of devices. A region may span any range: from a single sector to the whole device. A region may be further sub-divided into a number of distinct areas (one or more), each with its own counter set. In addition, one or more regions on one device can be combined into a statistics group. Groups allow several regions to be aggregated and reported as a single entity. By default new regions span the entire device.

๐Ÿ”– Region identifiers

Each region is assigned an identifier when it is created that is used to reference the region in subsequent operations. Region identifiers are unique within a given device (including across different program_id values). Depending on the sequence of create and delete operations, gaps may exist in the sequence of region_id values for a particular device.

๐Ÿ”– Group identifiers

Groups are also assigned an integer identifier at creation time; like region identifiers, group identifiers are unique within the containing device.

๐Ÿ“„ FILE MAPPING

Using --filemap, it is possible to create regions that correspond to the extents of a file in the file system. This allows IO statistics to be monitored on a per-file basis. To be able to use file mapping, the file must be backed by a device-mapper device, and in a file system that supports the FIEMAP ioctl (e.g., xfs(5) and ext4(5)). By default the regions making up a file are placed together in a group, and the group alias is set to the basename of the file. The update_filemap command and dmfilemapd daemon are provided to update file mapped groups.

๐Ÿ“ File follow modes

The file map monitoring daemon can monitor files in two distinct ways: follow-inode mode and follow-path mode.

To stop the daemon, delete the group containing the mapped regions. The daemon can also be safely killed at any time and the group kept.

โš ๏ธ Limitations

The daemon attempts to maintain good synchronisation between the file extents and the regions, but there are inevitably some IO events that cannot be counted when a file is growing. There is a further loss of events in that there is currently no way to atomically resize a dmstats region and preserve its current counter values. File mapping is currently most effective in cases where the majority of IO does not trigger extent allocation.

๐Ÿ“Š REPORT FIELDS

The dmstats report provides several types of field that may be added to the default field set, or used to create custom reports. All performance counters and metrics are calculated per-area.

๐Ÿ“ˆ Derived metrics

๐Ÿท๏ธ Group, region and area meta fields

๐Ÿ”ข Basic counters

๐Ÿ“Š Histogram fields

๐Ÿ’ก EXAMPLES

Create a whole-device region with one area on vg00/lvol1

# dmstats create vg00/lvol1
vg00/lvol1: Created new region with 1 area(s) as region ID 0

Create a 32M region 1G into device d0

# dmstats create --start 1G --length 32M d0
d0: Created new region with 1 area(s) as region ID 0

Create a whole-device region with 8 areas on every device

# dmstats create --areas 8
vg00-lvol1: Created new region with 8 area(s) as region ID 0
vg00-lvol2: Created new region with 8 area(s) as region ID 0
vg00-lvol3: Created new region with 8 area(s) as region ID 0
vg01-lvol0: Created new region with 8 area(s) as region ID 2
vg01-lvol1: Created new region with 8 area(s) as region ID 0
vg00-lvol2: Created new region with 8 area(s) as region ID 1

Delete all regions on all devices

# dmstats delete --alldevices --allregions

Create a whole-device region with areas 10GiB in size on vg00/lvol1 using dmsetup

# dmsetup stats create --areasize 10G vg00/lvol1
vg00-lvol1: Created new region with 5 area(s) as region ID 1

Create a 1GiB region with 16 areas at the start of vg00/lvol1

# dmstats create --start 0 --len 1G --areas=16 vg00/lvol1
vg00-lvol1: Created new region with 16 area(s) as region ID 0

List the statistics regions registered on vg00/lvol1

# dmstats list vg00/lvol1
Name             RgID  RStart RSize  #Areas ASize  ProgID
vg00-lvol1           0      0 61.00g      1 61.00g dmstats
vg00-lvol1           1 61.00g 19.20g      1 19.20g dmstats
vg00-lvol1           2 80.20g  2.14g      1  2.14g dmstats

Display five statistics reports for vg00/lvol1 at an interval of one second

# dmstats report --interval 1 --count 5 vg00/lvol1
# dmstats report
Name              RgID   ArID   AStart  ASize   RRqM/s    WRqM/s    R/s    W/s    RSz/s WSz/s
AvRqSz  QSize Util%      AWait RdAWa WrAWa
vg_hex-lv_home       0     0      0 61.00g      0.00      0.00   0.00  218.00      0    1.04m
4.50k  2.97      81.70 13.62  0.00 13.62
vg_hex-lv_home        1      0  61.00g  19.20g      0.00      0.00  0.00   5.00     0 548.00k
109.50k  0.14      11.00 27.40  0.00 27.40
vg_hex-lv_home       2     0 80.20g  2.14g      0.00      0.00   0.00   14.00      0    1.15m
84.00k  0.39      18.70 27.71  0.00 27.71

Create one region for each target contained in device vg00/lvol1

# dmstats create --segments vg00/lvol1
vg00-lvol1: Created new region with 1 area(s) as region ID 0
vg00-lvol1: Created new region with 1 area(s) as region ID 1
vg00-lvol1: Created new region with 1 area(s) as region ID 2

Create regions mapping each file in the directory images/ and place them into separate groups

# dmstats create --filemap images/*
images/vm1.qcow2: Created new group with 87 region(s) as group ID 0.
images/vm1-1.qcow2: Created new group with 8 region(s) as group ID 87.
images/vm2.qcow2: Created new group with 11 region(s) as group ID 95.
images/vm2-1.qcow2: Created new group with 1454 region(s) as group ID 106.
images/vm3.img: Created new group with 2 region(s) as group ID 1560.

Print raw counters for region 4 on device d0

# dmstats print --regionid 4 d0
2097152+65536 0 0 0 0 29 0 264 701 0 41 701 0 41

โœ๏ธ AUTHORS

Bryn M. Reeves <bmr AT redhat.com>

๐Ÿ”— SEE ALSO

Linux                                                                                                                                                                                                                                                                 Jun 23 2016                                                                                                                                                                                                                         DMSTATS(8)

dmstats(8)
๐Ÿ“‹ NAME ๐Ÿš€ Quick Reference ๐Ÿ” SYNOPSIS ๐Ÿ“ DESCRIPTION โš™๏ธ OPTIONS ๐Ÿ“‚ COMMANDS
๐Ÿงน clear ๐Ÿ†• create ๐Ÿ—‘๏ธ delete ๐Ÿ”— group โ“ help ๐Ÿ“‹ list ๐Ÿ–จ๏ธ print ๐Ÿ“Š report ๐Ÿ”“ ungroup ๐Ÿ”„ update_filemap
๐Ÿท๏ธ REGIONS, AREAS, AND GROUPS
๐Ÿ”– Region identifiers ๐Ÿ”– Group identifiers
๐Ÿ“„ FILE MAPPING
๐Ÿ“ File follow modes โš ๏ธ Limitations
๐Ÿ“Š REPORT FIELDS
๐Ÿ“ˆ Derived metrics ๐Ÿท๏ธ Group, region and area meta fields ๐Ÿ”ข Basic counters ๐Ÿ“Š Histogram fields
๐Ÿ’ก EXAMPLES
Create a whole-device region with one area on vg00/lvol1 Create a 32M region 1G into device d0 Create a whole-device region with 8 areas on every device Delete all regions on all devices Create a whole-device region with areas 10GiB in size on vg00/lvol1 using dmsetup Create a 1GiB region with 16 areas at the start of vg00/lvol1 List the statistics regions registered on vg00/lvol1 Display five statistics reports for vg00/lvol1 at an interval of one second Create one region for each target contained in device vg00/lvol1 Create regions mapping each file in the directory images/ and place them into separate groups Print raw counters for region 4 on device d0
โœ๏ธ AUTHORS ๐Ÿ”— SEE ALSO

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-11 22:35 @216.73.216.209
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^