Linux "dmstats" Command Line Options and Examples
device-mapper statistics management

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.


Usage:

dmsetup stats command [OPTIONS]




Command Line Options:

--alias
Specify an alias name for a group.
dmstats --alias ...
--alldevices
If no device arguments are given allow operation on all devices when creating or deleting regions.
dmstats --alldevices ...
--allprograms
Include regions from all program IDs for list and report operations.
dmstats --allprograms ...
--allregions
Include all present regions for commands that normally accept a single region identifier.
dmstats --allregions ...
--area
When peforming a list or report, include objects of type area in the results.
dmstats --area ...
--areas
Specify the number of statistics areas to create within a new region.
dmstats --areas ...
--areasize
Specify the size of areas into which a new region should be divided. An optional suffix selects units of: (b)ytes, (s)ectors,(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)instead of 1024.
dmstats --areasize ...
--clear
When printing statistics counters, also atomically reset them to zero.
dmstats --clear ...
--count
Specify the iteration count for repeating reports. If the count argument is zero reports will continue to repeat until inter‐rupted.
dmstats --count ...
--group
When peforming a list or report, include objects of type group in the results.
dmstats --group ...
--filemap
Instead of creating regions on a device as specified by command line options, open the file found at each file_path argument,and create regions corresponding to the locations of the on-disk extents allocated to the file(s).
dmstats --filemap ...
--nomonitor
Disable the dmfilemapd daemon when creating new file mapped groups. Normally the device-mapper filemap monitoring daemon,dmfilemapd, is started for each file mapped group to update the set of regions as the file changes on-disk: use of this optiondisables this behaviour.Regions in the group may still be updated with the update_filemap command, or by starting the daemon manually.
dmstats --nomonitor ...
--follow
Specify the dmfilemapd file following mode. The file map monitoring daemon can monitor files in two distinct ways: the modeaffects the behaviour of the daemon when a file under monitoring is renamed or unlinked, and the conditions which cause thedaemon to terminate.The follow_mode argument is either "inode", for follow-inode mode, or "path", for follow-path.If follow-inode mode is used, the daemon will hold the file open, and continue to update regions from the same file descrip‐tor. This means that the mapping will follow rename, move (within the same file system), and unlink operations. This mode isuseful if the file is expected to be moved, renamed, or unlinked while it is being monitored.In follow-inode mode, the daemon will exit once it detects that the file has been unlinked and it is the last holder of a ref‐erence to it.If follow-path is used, the daemon will re-open the provided path on each monitoring iteration. This means that the group willbe updated to reflect a new file being moved to the same path as the original file. This mode is useful for files that areexpected to be updated via unlink and rename.In follow-path mode, the daemon will exit if the file is removed and not replaced within a brief tolerance interval.In either mode, the daemon exits automatically if the monitored group is removed.
dmstats --follow ...
--foreground
Specify that the dmfilemapd daemon should run in the foreground. The daemon will not fork into the background, and willreplace the dmstats command that started it.
dmstats --foreground ...
--groupid
Specify the group to operate on.
dmstats --groupid ...
--bounds
Specify the boundaries of a latency histogram to be tracked for the region as a comma separated list of latency values.Latency values are given in nanoseconds. An optional unit suffix of ns, us, ms, or s may be given after each value to specifyunits of nanoseconds, microseconds, miliseconds or seconds respectively.
dmstats --bounds ...
--histogram
When used with the report and list commands select default fields that emphasize latency histogram data.
dmstats --histogram ...
--interval
Specify the interval in seconds between successive iterations for repeating reports. If --interval is specified but --count isnot, reports will continue to repeat until interrupted.
dmstats --interval ...
--length
Specify the length of a new statistics region in sectors. An optional suffix selects units of: (b)ytes, (s)ectors,(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)instead of 1024.
dmstats --length ...
-j|--major
Specify the major number.
dmstats -j|--major ...
-m|--minor
Specify the minor number.
dmstats -m|--minor ...
--nogroup
When creating regions mapping the extents of a file in the file system, do not create a group or set an alias.
dmstats --nogroup ...
--nosuffix
Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output.
dmstats --nosuffix ...
--notimesuffix
Suppress the suffix on output time values. Histogram boundary values will be reported in units of nanoseconds.
dmstats --notimesuffix ...
-o|--options
Specify which report fields to display.
dmstats -o|--options ...
-O|--sort
Sort output according to the list of fields given. Precede any sort field with '-' for a reverse sort on that column.
dmstats -O|--sort ...
--precise
Attempt to use nanosecond precision counters when creating new statistics regions.
dmstats --precise ...
--programid
Specify a program ID string. When creating new statistics regions this string is stored with the region. Subsequent operationsmay supply a program ID in order to select only regions with a matching value. The default program ID for dmstats-managedregions is "dmstats".
dmstats --programid ...
--region
When peforming a list or report, include objects of type region in the results.
dmstats --region ...
--regionid
Specify the region to operate on.
dmstats --regionid ...
--regions
Specify a list of regions to group. The group list is a comma-separated list of region identifiers. Continuous sequences ofidentifiers may be expressed as a hyphen separated range, for example: '1-10'.
dmstats --regions ...
--relative
If displaying the histogram report show relative (percentage) values instead of absolute counts.
dmstats --relative ...
-S|--select
Display only rows that match selection criteria. All rows with the additional "selected" column (-o selected) showing 1 if therow matches the selection and 0 otherwise. The selection criteria are defined by specifying column names and their valid val‐ues while making use of supported comparison operators.
dmstats -S|--select ...
--start
Specify the start offset of a new statistics region in sectors. An optional suffix selects units of: (b)ytes, (s)ectors,(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)instead of 1024.
dmstats --start ...
--segments
When used with create, create a new statistics region for each target contained in the given device(s). This causes a separateregion to be allocated for each segment of the device.The newly created regions are automatically placed into a group unless the --nogroup option is given. When grouping is enableda group alias may be specified using the --alias option.
dmstats --segments ...
--units
Set the display units for report output. All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)instead of 1024. Can also specify custom units e.g. --units 3M.
dmstats --units ...
--userdata
Specify user data (a word) to be stored with a new region. The value is added to any internal auxilliary data (for example,group information), and stored with the region in the aux_data field provided by the kernel. Whitespace is not permitted.
dmstats --userdata ...
-u|--uuid
Specify the uuid.
dmstats -u|--uuid ...
-v|--verbose
Produce additional output.COMMANDSclear device_name [--allprograms|--programid id] [--allregions|--regionid id]Instructs the kernel to clear statistics counters for the speficied regions (with the exception of in-flight IO counters).create device_name...|file_path...|--alldevices [--areas nr_areas|--areasize area_size] [--bounds histogram_boundaries] [--filemap]
dmstats -v|--verbose ...
--allregions|--regionid
id] [--area] [--region] [--group] [-O|--sort sort_fields] [-S|--select selection] [--units units]
dmstats --allregions|--regionid ...
--nosuffix]
Start a report for the specified object or for all present objects. If the count argument is specified, the report will repeatat a fixed interval set by the --interval option. The default interval is one second.If the --allprograms switch is given, all regions will be listed, regardless of region program ID values.If the --histogram is given the report will include the histogram values and latency boundaries.If the --relative is used the default histogram field displays bin values as a percentage of the total number of I/Os.Object types (areas, regions and groups) to include in the report are selected using the --area, --region, and --groupoptions.ungroup [device_name|--alldevices] [--groupid id]Remove an existing group and return all the group's regions to their original state.The group to be removed is specified using --groupid.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, either directly, or bystarting the monitoring daemon, dmfilemapd.This will add and remove regions to reflect changes in the allocated extents of the file on-disk, since the time that it wascrated or last updated.Use of this command is not normally needed since the dmfilemapd daemon will automatically monitor filemap groups and performthese updates when required.If a filemapped group was created with --nomonitor, or the daemon has been killed, the update_filemap can be used to manuallyforce an update or start a new daemon.Use --nomonitor to force a direct update and disable starting the monitoring daemon.REGIONS, AREAS, AND GROUPSThe device-mapper statistics facility allows separate performance counters to be maintained for arbitrary regions of devices. Aregion may span any range: from a single sector to the whole device. A region may be further sub-divided into a number of distinctareas (one or more), each with its own counter set. In this case a summary value for the entire region is also available for use inreports.In addition, one or more regions on one device can be combined into a statistics group. Groups allow several regions to be aggregatedand reported as a single entity; counters for all regions and areas are summed and used to report totals for all group members.Groups also permit the assignment of an optional alias, allowing meaningful names to be associated with sets of regions.The group metadata is stored with the first (lowest numbered) region_id in the group: deleting this region will also delete the groupand other group members will be returned to their prior state.By default new regions span the entire device. The --start and --length options allows a region of any size to be placed at any loca‐tion on the device.Using offsets it is possible to create regions that map individual objects within a block device (for example: partitions, files in afile system, or stripes or other structures in a RAID volume). Groups allow several non-contiguous regions to be assembled togetherfor reporting and data aggregation.A region may be either divided into the specified number of equal-sized areas, or into areas of the given size by specifying one of
dmstats --nosuffix] ...