Bug 1267664

Summary: add IO statistics reporting to dmsetup
Product: Red Hat Enterprise Linux 6 Reporter: Bryn M. Reeves <bmr>
Component: lvm2Assignee: Bryn M. Reeves <bmr>
lvm2 sub component: dmsetup (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact: Steven J. Levine <slevine>
Severity: medium    
Priority: high CC: agk, bgoncalv, bmr, cmarthal, heinzm, jbrassow, jeder, msnitzer, prajnoha, prockai, sgilson, slevine, tlavigne, zkabelac
Version: 6.7   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.140-1.el6 Doc Type: Release Note
Doc Text:
Support for device-mapper statistics facility (`dmstats`) The Red Hat Enterprise Linux 6.8 release supports a device-mapper statistics facility, the `dmstats` program. The `dmstats` program displays and manages I/O statistics for user-defined regions of devices that use the device-mapper driver. The `dmstats` program provides a similar functionality to the `iostats` program, but at levels of finer granularity than a whole device. For information on the `dmstats` program, see the `dmstats`(8) man page.
Story Points: ---
Clone Of: 1222101 Environment:
Last Closed: 2016-05-11 01:18:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1267632    
Bug Blocks: 1217621, 1268411    

Description Bryn M. Reeves 2015-09-30 15:23:59 UTC
+++ This bug was initially created as a clone of Bug #1222101 +++

Description of problem:
The kernel has supported configurable IO statistic for device-mapper devices since 3.11. Enabling and using them currently requires manual use of the device-mapper message facility and returns values in terms of diskstats-style counter sets.

Adding statistics support to libdevmapper and dmsetup would simplify configuration, inspection and management of device-mapper IO statistics and provide common mechanisms for use in other device-mapper applications like lvm2 and multipath-tools.

Version-Release number of selected component (if applicable):
lvm2-2.02.118.el6

How reproducible:
100%

Steps to Reproduce:
1. dmsetup --help

Actual results:
Np statistics commands.

Additional info:

dm-stats kernel interface: see Documentation/device-mapper/statistics.txt

--- Additional comment from Peter Rajnoha on 2015-08-10 03:57:42 EDT ---

New "dmstats" commands has been added in recent lvm2 v2.02.127 upstream which is going to be included in RHEL 7.2 device-mapper subpackage (device-mapper v 1.02.104, a subpackage of lvm2).

See also man dmstats(8) for more info on usage.

Comment 4 Bruno Goncalves 2016-01-27 14:01:02 UTC
Verified on:
lvm2-2.02.140-1.el6.
kernel-2.6.32-604.el6

# dmstats create --alldevices --precise
vg_intelcanoepass01-lv_home: Created new region with 1 area(s) as region ID 0
vg_intelcanoepass01-lv_swap: Created new region with 1 area(s) as region ID 0
vg_intelcanoepass01-lv_root: Created new region with 1 area(s) as region ID 0
vgtest-lvtest: Created new region with 1 area(s) as region ID 0

# dmstats list -o +precise
Name                        RgID RgSta RgSize  #Areas ArSize  ProgID  Precise
vg_intelcanoepass01-lv_home    0     0   1.30t      1   1.30t dmstats 1      
vg_intelcanoepass01-lv_swap    0     0  15.69g      1  15.69g dmstats 1      
vg_intelcanoepass01-lv_root    0     0  50.00g      1  50.00g dmstats 1      
vgtest-lvtest                  0     0 200.00m      1 200.00m dmstats 1      

# dmstats create --start 10g --len 10g vgtest-lvtest
vgtest-lvtest: Created new region with 1 area(s) as region ID 1

# dmstats create --precise --bounds 10ms,20ms,30ms vgtest-lvtest
vgtest-lvtest: Created new region with 1 area(s) as region ID 2

# dmstats list --histogram
Name                        RgID RgStar RgSize  #Areas ArSize  #Bins     Histogram Bounds 
vg_intelcanoepass01-lv_home    0      0   1.30t      1   1.30t 0                          
vg_intelcanoepass01-lv_swap    0      0  15.69g      1  15.69g 0                          
vg_intelcanoepass01-lv_root    0      0  50.00g      1  50.00g 0                          
vgtest-lvtest                  0      0 200.00m      1 200.00m 0                          
vgtest-lvtest                  1 10.00g  10.00g      1  10.00g 0                          
vgtest-lvtest                  2      0 200.00m      1 200.00m 4         0s,10ms,20ms,30ms

# dmstats list -o +precise,hist_bins
Name                        RgID RgStar RgSize  #Areas ArSize  ProgID  Precise #Bins    
vg_intelcanoepass01-lv_home    0      0   1.30t      1   1.30t dmstats 1       0        
vg_intelcanoepass01-lv_swap    0      0  15.69g      1  15.69g dmstats 1       0        
vg_intelcanoepass01-lv_root    0      0  50.00g      1  50.00g dmstats 1       0        
vgtest-lvtest                  0      0 200.00m      1 200.00m dmstats 1       0        
vgtest-lvtest                  1 10.00g  10.00g      1  10.00g dmstats 0       0        
vgtest-lvtest                  2      0 200.00m      1 200.00m dmstats 1       4   

# dmstats delete --regionid 1 vgtest-lvtest
#

# dmstats list --histogram
Name                        RgID RgSta RgSize  #Areas ArSize  #Bins     Histogram Bounds 
vg_intelcanoepass01-lv_home    0     0   1.30t      1   1.30t 0                          
vg_intelcanoepass01-lv_swap    0     0  15.69g      1  15.69g 0                          
vg_intelcanoepass01-lv_root    0     0  50.00g      1  50.00g 0                          
vgtest-lvtest                  0     0 200.00m      1 200.00m 0                          
vgtest-lvtest                  2     0 200.00m      1 200.00m 4         0s,10ms,20ms,30ms

# dmstats delete --allregions vgtest-lvtest
#

# dmstats list --histogram
Name                        RgID RgSta RgSize #Areas ArSize #Bins     Histogram Bounds
vg_intelcanoepass01-lv_home    0     0  1.30t      1  1.30t 0                         
vg_intelcanoepass01-lv_swap    0     0 15.69g      1 15.69g 0                         
vg_intelcanoepass01-lv_root    0     0 50.00g      1 50.00g 0   

# dmstats delete --allregions --alldevices
#

# dmstats list --histogram
#

Comment 6 errata-xmlrpc 2016-05-11 01:18:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0964.html