dev-prajnoha-pv-ext-flag-used - libdm: ensure dm_stats_get_area_offset() returns a value
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=427d0a5e925d86...
Commit: 427d0a5e925d86145df12313aa36d5c61ff59bd5
Parent: 623b46a17d4163b42f9f65c41d5c8d8f95ec95c5
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Mon Aug 17 13:56:44 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Mon Aug 17 14:40:48 2015 +0100
libdm: ensure dm_stats_get_area_offset() returns a value
---
libdm/libdm-stats.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 400b12d..50492f3 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -1341,6 +1341,7 @@ uint64_t dm_stats_get_area_offset(const struct dm_stats *dms, uint64_t *offset,
if (!dms || !dms->regions)
return_0;
*offset = dms->regions[region_id].step * area_id;
+ return 1;
}
uint64_t dm_stats_get_current_area_start(const struct dm_stats *dms,
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - device: Don't try to close config file on failure.
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=623b46a17d4163...
Commit: 623b46a17d4163b42f9f65c41d5c8d8f95ec95c5
Parent: a606966029d411a1336eb5bc2f99a4162e0d97d6
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Aug 17 12:57:01 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Aug 17 12:57:01 2015 +0100
device: Don't try to close config file on failure.
$file: open failed: Permission denied
Failed to load config file $file
Attempt to close device '$file' which is not open.
---
WHATS_NEW | 1 +
lib/config/config.c | 5 ++++-
lib/device/dev-cache.c | 10 ++++++++++
lib/device/dev-io.c | 8 ++------
lib/device/device.h | 1 +
5 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index dbb78d6..7508794 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.128 -
===================================
+ Don't attempt to close config file that couldn't be opened.
Check for valid cache mode in validation of cache segment.
Change internal interface handling cache mode and policy.
When no cache policy specified, prefer smq (if available) over mq.
diff --git a/lib/config/config.c b/lib/config/config.c
index cd6c1d8..ad2db76 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -582,8 +582,11 @@ int config_file_read(struct dm_config_tree *cft)
if (!(cf->dev = dev_create_file(filename, NULL, NULL, 1)))
return_0;
- if (!dev_open_readonly_buffered(cf->dev))
+ if (!dev_open_readonly_buffered(cf->dev)) {
+ dev_destroy_file(cf->dev);
+ cf->dev = NULL;
return_0;
+ }
}
r = config_file_read_fd(cft, cf->dev, 0, (size_t) info.st_size, 0, 0,
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index e58ac0f..043a722 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -71,6 +71,16 @@ static void _dev_init(struct device *dev, int max_error_count)
dm_list_init(&dev->open_list);
}
+void dev_destroy_file(struct device *dev)
+{
+ if (!(dev->flags & DEV_ALLOCED))
+ return;
+
+ dm_free((void *) dm_list_item(dev->aliases.n, struct dm_str_list)->str);
+ dm_free(dev->aliases.n);
+ dm_free(dev);
+}
+
struct device *dev_create_file(const char *filename, struct device *dev,
struct dm_str_list *alias, int use_malloc)
{
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index d712f31..8c2388b 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -586,12 +586,8 @@ static void _close(struct device *dev)
log_debug_devs("Closed %s", dev_name(dev));
- if (dev->flags & DEV_ALLOCED) {
- dm_free((void *) dm_list_item(dev->aliases.n, struct dm_str_list)->
- str);
- dm_free(dev->aliases.n);
- dm_free(dev);
- }
+ if (dev->flags & DEV_ALLOCED)
+ dev_destroy_file(dev);
}
static int _dev_close(struct device *dev, int immediate)
diff --git a/lib/device/device.h b/lib/device/device.h
index dcc3713..733b0d0 100644
--- a/lib/device/device.h
+++ b/lib/device/device.h
@@ -123,6 +123,7 @@ void dev_flush(struct device *dev);
struct device *dev_create_file(const char *filename, struct device *dev,
struct dm_str_list *alias, int use_malloc);
+void dev_destroy_file(struct device *dev);
/* Return a valid device name from the alias list; NULL otherwise */
const char *dev_name_confirmed(struct device *dev, int quiet);
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - cache: use undefined settings for cache_policy
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d4c024c836aa10...
Commit: d4c024c836aa10be0fe4d55157bac15f5ede62a8
Parent: b297d78367c2a9395bcc6abc7484763368979842
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Aug 17 11:19:28 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Aug 17 11:25:03 2015 +0200
cache: use undefined settings for cache_policy
As cache_policy is evaluated in runtime, we no longer should use
CFG_COMMENTED, but have to switch to CFG_UNDEFINED.
So as long as the value is undefined, it's runtime evaluated.
Once it's set - it's always respected (no runtime fallback).
Also fix version of introduced settings to 2.2.128.
---
lib/config/config_settings.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index b687c57..f18d173 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -474,13 +474,13 @@ cfg(allocation_cache_mode_CFG, "cache_mode", allocation_CFG_SECTION, CFG_DEFAULT
"writeback - Data blocks are written from the cache back\n"
"to disk after some delay to improve performance.\n")
-cfg_runtime(allocation_cache_policy_CFG, "cache_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, vsn(2, 2, 127), 0, NULL,
+cfg_runtime(allocation_cache_policy_CFG, "cache_policy", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, vsn(2, 2, 128), 0, NULL,
"The default cache policy used for new cache volume.\n"
- "Generally available policies are: mq, smq.\n"
- "mq - Multiqueue policy with 88 bytes per block\n"
- "smq - Stochastic multique with 25 bytes per block (kernel >= 4.2).\n")
+ "For the kernel 4.2 and newer the default policy is smq\n"
+ "(Stochastic multique), otherwise the older mq (Multiqueue),\n"
+ "policy is selected.\n")
-cfg_section(allocation_cache_settings_CFG_SECTION, "cache_settings", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, vsn(2, 2, 127), 0, NULL,
+cfg_section(allocation_cache_settings_CFG_SECTION, "cache_settings", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, vsn(2, 2, 128), 0, NULL,
"Individual settings for policies.\n"
"See the help for individual policies for more info.\n")
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - WHATS_NEW: Update.
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b297d78367c2a9...
Commit: b297d78367c2a9395bcc6abc7484763368979842
Parent: 4a6d5e2012cbcf40842b5ef051347694bbf5ca04
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sun Aug 16 01:16:16 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sun Aug 16 01:16:16 2015 +0100
WHATS_NEW: Update.
---
WHATS_NEW | 7 +++----
WHATS_NEW_DM | 6 +++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 1e34e1c..dbb78d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,10 +1,9 @@
Version 2.02.128 -
===================================
Check for valid cache mode in validation of cache segment.
- Enhance internal API cache_set_mode() and cache_set_policy().
- Enhance toollib's get_cache_params().
- Runtime detect presence of cache smq policy.
- Add demo cache-mq and cache-smq profiles.
+ Change internal interface handling cache mode and policy.
+ When no cache policy specified, prefer smq (if available) over mq.
+ Add demo cache-mq and cache-smq profiles.
Add cmd profilable allocation/cache_policy,cache_settings,cache_mode.
Require cache_check 0.5.4 for use of --clear-needs-check-flag.
Fix lvmetad udev rules to not override SYSTEMD_WANTS, add the service instead.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8e816a0..870ffb2 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,8 +1,8 @@
Version 1.02.105 -
===================================
- Fix 'stats list -o all' segfault
- Separate statistics fields from region information fields
- Add interval and interval_ns fields to DR_STATS reports.
+ Fix 'dmstats list -o all' segfault.
+ Separate dmstats statistics fields from region information fields.
+ Add interval and interval_ns fields to dmstats reports.
Do not include internal glibc headers in libdm-timestamp.c (1.02.104)
Exit immediately if no device is supplied to dmsetup wipe_table.
Suppress dmsetup report headings when no data is output. (1.02.104)
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - dmstats: fix --length argument
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4a6d5e2012cbcf...
Commit: 4a6d5e2012cbcf40842b5ef051347694bbf5ca04
Parent: 9d5cd4ca14a94d83bf7b3c0b73896abc4ff8926c
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Sat Aug 15 16:51:31 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Sat Aug 15 18:35:10 2015 +0100
dmstats: fix --length argument
Commit f10ad95 introduced a regression causing the size of regions
passed in on the command line to be truncated to zero. Initialise
the 'this_len' variable to the supplied length to correct this.
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index ee1e1fe..097f1fd 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -4456,7 +4456,7 @@ static int _do_stats_create_regions(struct dm_stats *dms,
const char *program_id,
const char *aux_data)
{
- uint64_t this_start = 0, this_len = 0, region_id = UINT64_C(0);
+ uint64_t this_start = 0, this_len = len, region_id = UINT64_C(0);
char *target_type, *params; /* unused */
struct dm_task *dmt;
struct dm_info info;
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - dmstats: change region fields prefix to 'region_'
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0b487802a041a0...
Commit: 0b487802a041a0848e927e3dfc3d71618b66ca42
Parent: f3891e90e32d0b76dc8c3ef2fb9bddbe09ffb846
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Aug 14 23:53:42 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Aug 14 23:53:42 2015 +0100
dmstats: change region fields prefix to 'region_'
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index f90ce3e..9e72226 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3915,7 +3915,7 @@ static const struct dm_report_object_type _report_types[] = {
{ DR_TREE, "Mapped Device Relationship Information", "tree_", _tree_get_obj },
{ DR_NAME, "Mapped Device Name Components", "splitname_", _split_name_get_obj },
{ DR_STATS, "Mapped Device Statistics","stats_", _stats_get_obj },
- { DR_STATS_META, "Mapped Device Statistics Region Information","stats_region_", _stats_get_obj },
+ { DR_STATS_META, "Mapped Device Statistics Region Information","region_", _stats_get_obj },
{ 0, "", "", NULL }
};
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - dmstats: make -v enable per area reports for 'stats list'
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f3891e90e32d0b...
Commit: f3891e90e32d0b76dc8c3ef2fb9bddbe09ffb846
Parent: 0f3b81bb2e7de61457ec0f2a72f381b9992421c6
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Aug 14 20:40:13 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Aug 14 22:03:37 2015 +0100
dmstats: make -v enable per area reports for 'stats list'
When dmstats is run with -v or higher enable a per-area reporting
mode for statistics regions. This will output one row per area
(rather than one row per region) and adds additional fields of use
when viewing areas:
area_id - index within the region assigned by libdm-stats
area_start - the start location of the area in the containing
device.
---
man/dmstats.8.in | 6 ++++++
tools/dmsetup.c | 43 +++++++++++++++++++++++++++++++++----------
2 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index f8d2949..a6b2ff5 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -63,6 +63,8 @@ dmstats \(em device-mapper statistics management
.RB [ \-\-units
.IR units ]
.RB [ \-\-nosuffix ]
+.RB [ \-\-nosuffix ]
+.RB [ \-v | \-\-verbose \ [ \-v | \-\-verbose ]
.br
.B dmstats print
.RI [ device_name ]
@@ -302,11 +304,15 @@ the list of report fields.
.RI [ device_name ]
.RB [ \-\-allprograms ]
.RB [ \-\-programid
+.RB [ \-v | \-\-verbose \ [ \-v | \-\-verbose ]]
.IR id ]
.br
List the statistics regions registered on the device. If the
\fB\-\-allprograms\fP switch is given all regions will be listed
regardless of region program ID values.
+
+If \fB\-v\fP or \fB\-\-verbose\fP is given the report will include
+a row of information for each area contained in each region displayed.
.br
.TP
.B print
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index f69fbe4..f90ce3e 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -256,6 +256,7 @@ static struct dm_timestamp *_initial_timestamp = NULL;
static uint64_t _disp_factor = 512; /* display sizes in sectors */
static char _disp_units = 's';
const char *_program_id = DM_STATS_PROGRAM_ID; /* program_id used for reports. */
+static int _stats_report_by_areas = 1; /* output per-area info for stats reports. */
/* report timekeeping */
static struct dm_timestamp *_cycle_timestamp = NULL;
@@ -859,8 +860,10 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info)
dm_stats_walk_do(obj.stats) {
if (!dm_report_object(_report, &obj))
goto_out;
- /* report walk is always by area */
- dm_stats_walk_next(obj.stats);
+ if (_stats_report_by_areas)
+ dm_stats_walk_next(obj.stats);
+ else
+ dm_stats_walk_next_region(obj.stats);
} dm_stats_walk_while(obj.stats);
r = 1;
@@ -4024,15 +4027,23 @@ FIELD_F(STATS_META, STR, "AuxDat", 6, dm_stats_aux_data, "aux_data", "Auxiliary
static const char *default_report_options = "name,major,minor,attr,open,segments,events,uuid";
static const char *splitname_report_options = "vg_name,lv_name,lv_layer";
-#define DEV_INFO_STATS "name,region_id"
+/* Stats counters & derived metrics. */
#define RD_COUNTERS "reads,reads_merged,read_sectors,read_nsecs,total_rd_nsecs"
#define WR_COUNTERS "writes,writes_merged,write_sectors,write_nsecs,total_wr_nsecs"
#define IO_COUNTERS "in_progress,io_nsecs,weighted_io_nsecs"
#define METRICS "rrqm,wrqm,rs,ws,rsize_sec,wsize_sec,arqsz,qusz,util,await,r_await,w_await"
#define COUNTERS RD_COUNTERS "," WR_COUNTERS "," IO_COUNTERS
-static const char *_stats_default_report_options = DEV_INFO_STATS ",area_id,area_start,area_len," METRICS;
-static const char *_stats_raw_report_options = DEV_INFO_STATS ",area_id,area_start,area_len," COUNTERS;
-static const char *_stats_list_options = "name,region_id,region_start,region_len,area_len,area_count,program_id";
+
+/* Device, region and area metadata. */
+#define STATS_DEV_INFO "name,region_id"
+#define STATS_AREA_INFO STATS_DEV_INFO ",region_start,region_len,area_count,area_id,area_start,area_len"
+#define STATS_REGION_INFO STATS_DEV_INFO ",region_start,region_len,area_count,area_len"
+
+/* Default stats report options. */
+static const char *_stats_default_report_options = STATS_DEV_INFO ",area_id,area_start,area_len," METRICS;
+static const char *_stats_raw_report_options = STATS_DEV_INFO ",area_id,area_start,area_len," COUNTERS;
+static const char *_stats_list_options = STATS_REGION_INFO ",program_id";
+static const char *_stats_area_list_options = STATS_AREA_INFO ",program_id";
static int _report_init(const struct command *cmd, const char *subcommand)
{
@@ -4055,11 +4066,14 @@ static int _report_init(const struct command *cmd, const char *subcommand)
if (cmd && !strcmp(cmd->name, "stats")) {
_report_type |= DR_STATS_META;
if (!strcmp(subcommand, "list"))
- options = (char *) _stats_list_options;
+ options = (char *) ((_switches[VERBOSE_ARG])
+ ? _stats_area_list_options
+ : _stats_list_options);
else {
- options = (char *) (!_switches[RAW_ARG])
+ options = (char *) ((!_switches[RAW_ARG])
? _stats_default_report_options
- : _stats_raw_report_options;
+ : _stats_raw_report_options);
+
_report_type |= DR_STATS;
}
}
@@ -4772,6 +4786,9 @@ static int _stats_report(CMD_ARGS)
if (_switches[ALL_PROGRAMS_ARG])
_program_id = "";
+ if (!_switches[VERBOSE_ARG] && !strcmp(subcommand, "list"))
+ _stats_report_by_areas = 0;
+
if (names)
name = names->name;
else {
@@ -5067,7 +5084,13 @@ static int _stats(CMD_ARGS)
return 0;
}
- if (!stats_cmd->fn(stats_cmd, NULL, argc, argv, NULL, multiple_devices))
+ /*
+ * Pass the sub-command through to allow a single function to be
+ * used to implement several distinct sub-commands (e.g. 'report'
+ * and 'list' share a single implementation.
+ */
+ if (!stats_cmd->fn(stats_cmd, subcommand, argc, argv, NULL,
+ multiple_devices))
return 0;
return 1;
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - libdm: ensure dm_stats_get_area_start includes region offset
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=77fae3d8522ffb...
Commit: 77fae3d8522ffb1077dcb0e2e9ebfba86cf19daf
Parent: 16ff2d927f6ce2f8c2ad8f7e6ec8fb52bd2a066c
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Aug 14 20:28:06 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Aug 14 22:03:37 2015 +0100
libdm: ensure dm_stats_get_area_start includes region offset
The dm_stats_get_area_start (and its '_current_' variant) methods
are expected to return the start sector of the area in the
containing device.
Make sure the call adds region->start to the returned value.
---
libdm/libdm-stats.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index ea4feef..51aba79 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -1328,9 +1328,10 @@ uint64_t dm_stats_get_current_region_area_len(const struct dm_stats *dms,
uint64_t dm_stats_get_area_start(const struct dm_stats *dms, uint64_t *start,
uint64_t region_id, uint64_t area_id)
{
+ struct dm_stats_region *region = &dms->regions[region_id];
if (!dms || !dms->regions)
return_0;
- *start = dms->regions[region_id].step * area_id;
+ *start = region->start + region->step * area_id;
return 1;
}
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - dmsetup: add support for 'stats report --raw'
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=16ff2d927f6ce2...
Commit: 16ff2d927f6ce2f8c2ad8f7e6ec8fb52bd2a066c
Parent: fc7a27bc3d8c14ba696cf6893708d2715918d564
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Aug 14 17:42:03 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Aug 14 22:03:37 2015 +0100
dmsetup: add support for 'stats report --raw'
Add a '--raw' switch to stats reports that causes us to report the
basic counter values rather than derived metrics for each visible
statistics region.
---
tools/dmsetup.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 66364ac..74e7806 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -191,6 +191,7 @@ enum {
NOUDEVSYNC_ARG,
OPTIONS_ARG,
PROGRAM_ID_ARG,
+ RAW_ARG,
READAHEAD_ARG,
REGION_ID_ARG,
RETRY_ARG,
@@ -3996,11 +3997,13 @@ static const char *default_report_options = "name,major,minor,attr,open,segments
static const char *splitname_report_options = "vg_name,lv_name,lv_layer";
#define DEV_INFO_STATS "name,region_id"
-#define RD_STATS "reads,reads_merged,read_sectors,read_nsecs,total_rd_nsecs"
-#define WR_STATS "writes,writes_merged,write_sectors,write_nsecs,total_wr_nsecs"
-#define IO_STATS "in_progress,io_nsecs,weighted_io_nsecs"
+#define RD_COUNTERS "reads,reads_merged,read_sectors,read_nsecs,total_rd_nsecs"
+#define WR_COUNTERS "writes,writes_merged,write_sectors,write_nsecs,total_wr_nsecs"
+#define IO_COUNTERS "in_progress,io_nsecs,weighted_io_nsecs"
#define METRICS "rrqm,wrqm,rs,ws,rsize_sec,wsize_sec,arqsz,qusz,util,await,r_await,w_await"
+#define COUNTERS RD_COUNTERS "," WR_COUNTERS "," IO_COUNTERS
static const char *_stats_default_report_options = DEV_INFO_STATS ",area_id,area_start,area_len," METRICS;
+static const char *_stats_raw_report_options = DEV_INFO_STATS ",area_id,area_start,area_len," COUNTERS;
static const char *_stats_list_options = "name,region_id,region_start,region_len,area_len,area_count,program_id";
static int _report_init(const struct command *cmd, const char *subcommand)
@@ -4026,7 +4029,9 @@ static int _report_init(const struct command *cmd, const char *subcommand)
if (!strcmp(subcommand, "list"))
options = (char *) _stats_list_options;
else {
- options = (char *) _stats_default_report_options;
+ options = (char *) (!_switches[RAW_ARG])
+ ? _stats_default_report_options
+ : _stats_raw_report_options;
_report_type |= DR_STATS;
}
}
@@ -5430,6 +5435,7 @@ static int _process_switches(int *argcp, char ***argvp, const char *dev_dir)
{"noudevsync", 0, &ind, NOUDEVSYNC_ARG},
{"options", 1, &ind, OPTIONS_ARG},
{"programid", 1, &ind, PROGRAM_ID_ARG},
+ {"raw", 0, &ind, RAW_ARG},
{"readahead", 1, &ind, READAHEAD_ARG},
{"regionid", 1, &ind, REGION_ID_ARG},
{"retry", 0, &ind, RETRY_ARG},
@@ -5579,6 +5585,8 @@ static int _process_switches(int *argcp, char ***argvp, const char *dev_dir)
_switches[PROGRAM_ID_ARG]++;
_string_args[PROGRAM_ID_ARG] = optarg;
}
+ if (ind == RAW_ARG)
+ _switches[RAW_ARG]++;
if (ind == REGION_ID_ARG) {
_switches[REGION_ID_ARG]++;
_int_args[REGION_ID_ARG] = atoi(optarg);
8 years, 9 months
dev-prajnoha-pv-ext-flag-used - dmsetup: add prefixes for all report types
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc7a27bc3d8c14...
Commit: fc7a27bc3d8c14ba696cf6893708d2715918d564
Parent: 666722324f870c7ef0fb03acb043a00567067188
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Aug 14 21:14:29 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Aug 14 22:03:37 2015 +0100
dmsetup: add prefixes for all report types
Add prefixes to all dmsetup report types to allow the 'group_all'
option to be effective:
DR_NAME name_
DR_INFO info_
DR_DEPS deps_
DR_TREE tree_
DR_NAME splitname_
---
tools/dmsetup.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 7dd58b1..66364ac 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3877,11 +3877,11 @@ static void *_stats_get_obj(void *obj)
}
static const struct dm_report_object_type _report_types[] = {
- { DR_TASK, "Mapped Device Name", "", _task_get_obj },
- { DR_INFO, "Mapped Device Information", "", _info_get_obj },
- { DR_DEPS, "Mapped Device Relationship Information", "", _deps_get_obj },
- { DR_TREE, "Mapped Device Relationship Information", "", _tree_get_obj },
- { DR_NAME, "Mapped Device Name Components", "", _split_name_get_obj },
+ { DR_TASK, "Mapped Device Name", "name_", _task_get_obj },
+ { DR_INFO, "Mapped Device Information", "info_", _info_get_obj },
+ { DR_DEPS, "Mapped Device Relationship Information", "deps_", _deps_get_obj },
+ { DR_TREE, "Mapped Device Relationship Information", "tree_", _tree_get_obj },
+ { DR_NAME, "Mapped Device Name Components", "splitname_", _split_name_get_obj },
{ DR_STATS, "Mapped Device Statistics","stats_", _stats_get_obj },
{ DR_STATS_META, "Mapped Device Statistics Region Information","stats_region_", _stats_get_obj },
{ 0, "", "", NULL }
8 years, 9 months