Skip to contentSkip to conversation

device-mapper ./WHATS_NEW dmsetup/dmsetup.c li ...

PATCH [email protected] 2 participants 2 messages Jun 24, 2008 – Jun 30, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: [email protected] 2008-06-24 22:53:48

Modified files:

	.              : WHATS_NEW 
	dmsetup        : dmsetup.c 
	lib            : libdevmapper.h libdm-report.c 

Log message:
Add --rows to dmsetup.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.243&r2=1.244
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.110&r2=1.111
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdevmapper.h.diff?cvsroot=dm&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-report.c.diff?cvsroot=dm&r1=1.20&r2=1.21

WHATS_NEW +1 -1
@@ -1,6 +1,6 @@
 Version 1.02.27 -
 ===============================
-  Add --unquoted to dmsetup.
+  Add --unquoted and --rows to dmsetup.
   Avoid compiler warning about cast in dmsetup.c's OFFSET_OF macro.
   Fix inverted no_flush debug message.
   Remove --enable-jobs from configure. (Set at runtime instead.)
dmsetup/dmsetup.c +12 -1
@@ -122,6 +122,7 @@
 	NOTABLE_ARG,
 	OPTIONS_ARG,
 	READAHEAD_ARG,
+	ROWS_ARG,
 	SEPARATOR_ARG,
 	SHOWKEYS_ARG,
 	SORT_ARG,
@@ -1976,7 +1977,8 @@
 	char *options = (char *) default_report_options;
 	const char *keys = "";
 	const char *separator = " ";
-	int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0, quoted = 1;
+	int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0;
+	int quoted = 1, columns_as_rows = 0;
 	uint32_t flags = 0;
 	size_t len = 0;
 	int r = 0;
@@ -1991,6 +1993,9 @@
 	if (_switches[UNBUFFERED_ARG])
 		buffered = 0;
 
+	if (_switches[ROWS_ARG])
+		columns_as_rows = 1;
+
 	if (_switches[UNQUOTED_ARG])
 		quoted = 0;
 
@@ -2047,6 +2052,9 @@
 	if (!quoted)
 		flags |= DM_REPORT_OUTPUT_FIELD_UNQUOTED;
 
+	if (columns_as_rows)
+		flags |= DM_REPORT_OUTPUT_COLUMNS_AS_ROWS;
+
 	if (!(_report = dm_report_init(&_report_type,
 				       _report_types, _report_fields,
 				       options, separator, flags, keys, NULL)))
@@ -2490,6 +2498,7 @@
 		{"notable", 0, &ind, NOTABLE_ARG},
 		{"options", 1, &ind, OPTIONS_ARG},
 		{"readahead", 1, &ind, READAHEAD_ARG},
+		{"rows", 0, &ind, ROWS_ARG},
 		{"separator", 1, &ind, SEPARATOR_ARG},
 		{"showkeys", 0, &ind, SHOWKEYS_ARG},
 		{"sort", 1, &ind, SORT_ARG},
@@ -2646,6 +2655,8 @@
 				}
 			}
 		}
+		if ((ind == ROWS_ARG))
+			_switches[ROWS_ARG]++;
 		if ((ind == SHOWKEYS_ARG))
 			_switches[SHOWKEYS_ARG]++;
 		if ((ind == TABLE_ARG)) {
lib/libdevmapper.h +1 -0
@@ -741,6 +741,7 @@
 #define DM_REPORT_OUTPUT_HEADINGS		0x00000004
 #define DM_REPORT_OUTPUT_FIELD_NAME_PREFIX	0x00000008
 #define DM_REPORT_OUTPUT_FIELD_UNQUOTED		0x00000010
+#define DM_REPORT_OUTPUT_COLUMNS_AS_ROWS	0x00000020
 
 struct dm_report *dm_report_init(uint32_t *report_types,
 				 const struct dm_report_object_type *types,
lib/libdm-report.c +159 -81

273 lines not on this page · raw message

#1 lore raw

Way to get IO stats on multipath alias?

OK so I make my alias in /etc/multipath.conf

        multipath {
                wwid                    1HITACHI_750140820017
                alias                   asm13
        }

And as expected all 4 paths are there and happy in Hitachi's active/passive world

asm13 (1HITACHI_750140820017) dm-44 HITACHI,DF600F [size=32G][features=0][hwhandler=0]
\_ round-robin 0 [prio=2][active]
\_ 1:0:0:17 sdbb 67:80 [active][ready]
\_ 0:0:0:17 sdr 65:16 [active][ready]
\_ round-robin 0 [prio=0][enabled]
\_ 0:0:1:17 sdcq 69:224 [active][ready] \_ 1:0:1:17 sded 128:80 [active][ready]

Now I can do a iostat -x and get the stats for sdbb, sdr, dscq, and sded.

But is there a way to collect statistics on asm13?

Really need to know how it is doing on that level. Ya I can get info on dm-44, but that changes across reboots, and could be different on different nodes on the cluster....

Help!!!!

Craig