All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>,
	Stefan Haberland <stefan.haberland@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 18/60] dasd: improve dasd statistics proc interface
Date: Thu, 27 Nov 2008 11:30:38 +0100	[thread overview]
Message-ID: <20081127103132.813255499@de.ibm.com> (raw)
In-Reply-To: 20081127103020.528516828@de.ibm.com

[-- Attachment #1: 117-dasd-stats.diff --]
[-- Type: text/plain, Size: 4055 bytes --]

From: Stefan Haberland <stefan.haberland@de.ibm.com>

For a large number of I/O requests the values were shifted binary.
The shift was not transparent for the user because the shift value 
was not displayed. To make this interface more human readable the 
values are shifted decimal and the scale factor is displayed.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 drivers/s390/block/dasd_proc.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

Index: quilt-2.6/drivers/s390/block/dasd_proc.c
===================================================================
--- quilt-2.6.orig/drivers/s390/block/dasd_proc.c
+++ quilt-2.6/drivers/s390/block/dasd_proc.c
@@ -180,12 +180,12 @@ dasd_calc_metrics(char *page, char **sta
 
 #ifdef CONFIG_DASD_PROFILE
 static char *
-dasd_statistics_array(char *str, unsigned int *array, int shift)
+dasd_statistics_array(char *str, unsigned int *array, int factor)
 {
 	int i;
 
 	for (i = 0; i < 32; i++) {
-		str += sprintf(str, "%7d ", array[i] >> shift);
+		str += sprintf(str, "%7d ", array[i] / factor);
 		if (i == 15)
 			str += sprintf(str, "\n");
 	}
@@ -202,7 +202,7 @@ dasd_statistics_read(char *page, char **
 #ifdef CONFIG_DASD_PROFILE
 	struct dasd_profile_info_t *prof;
 	char *str;
-	int shift;
+	int factor;
 
 	/* check for active profiling */
 	if (dasd_profile_level == DASD_PROFILE_OFF) {
@@ -214,12 +214,14 @@ dasd_statistics_read(char *page, char **
 
 	prof = &dasd_global_profile;
 	/* prevent couter 'overflow' on output */
-	for (shift = 0; (prof->dasd_io_reqs >> shift) > 9999999; shift++);
+	for (factor = 1; (prof->dasd_io_reqs / factor) > 9999999;
+	     factor *= 10);
 
 	str = page;
 	str += sprintf(str, "%d dasd I/O requests\n", prof->dasd_io_reqs);
-	str += sprintf(str, "with %d sectors(512B each)\n",
+	str += sprintf(str, "with %u sectors(512B each)\n",
 		       prof->dasd_io_sects);
+	str += sprintf(str, "Scale Factor is  %d\n", factor);
 	str += sprintf(str,
 		       "   __<4	   ___8	   __16	   __32	   __64	   _128	"
 		       "   _256	   _512	   __1k	   __2k	   __4k	   __8k	"
@@ -230,22 +232,22 @@ dasd_statistics_read(char *page, char **
 		       "   __1G	   __2G	   __4G " "   _>4G\n");
 
 	str += sprintf(str, "Histogram of sizes (512B secs)\n");
-	str = dasd_statistics_array(str, prof->dasd_io_secs, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_secs, factor);
 	str += sprintf(str, "Histogram of I/O times (microseconds)\n");
-	str = dasd_statistics_array(str, prof->dasd_io_times, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_times, factor);
 	str += sprintf(str, "Histogram of I/O times per sector\n");
-	str = dasd_statistics_array(str, prof->dasd_io_timps, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_timps, factor);
 	str += sprintf(str, "Histogram of I/O time till ssch\n");
-	str = dasd_statistics_array(str, prof->dasd_io_time1, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_time1, factor);
 	str += sprintf(str, "Histogram of I/O time between ssch and irq\n");
-	str = dasd_statistics_array(str, prof->dasd_io_time2, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_time2, factor);
 	str += sprintf(str, "Histogram of I/O time between ssch "
 			    "and irq per sector\n");
-	str = dasd_statistics_array(str, prof->dasd_io_time2ps, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_time2ps, factor);
 	str += sprintf(str, "Histogram of I/O time between irq and end\n");
-	str = dasd_statistics_array(str, prof->dasd_io_time3, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_time3, factor);
 	str += sprintf(str, "# of req in chanq at enqueuing (1..32) \n");
-	str = dasd_statistics_array(str, prof->dasd_io_nr_req, shift);
+	str = dasd_statistics_array(str, prof->dasd_io_nr_req, factor);
 	len = str - page;
 #else
 	len = sprintf(page, "Statistics are not activated in this kernel\n");

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

  parent reply	other threads:[~2008-11-27 10:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27 10:30 [patch 00/60] s390 feature patches for 2.6.29 Martin Schwidefsky
2008-11-27 10:30 ` [patch 01/60] vmcp: remove BKL Martin Schwidefsky
2008-11-27 10:30 ` [patch 02/60] arch_setup_additional_pages arguments Martin Schwidefsky
2008-11-27 10:30 ` [patch 03/60] introduce vdso on s390 Martin Schwidefsky
2008-11-27 10:30 ` [patch 04/60] convert etr/stp to stop_machine interface Martin Schwidefsky
2008-11-27 10:30 ` [patch 05/60] serialize stp/etr work Martin Schwidefsky
2008-11-27 10:30 ` [patch 06/60] convert s390 to generic IPI infrastructure Martin Schwidefsky
2008-11-27 10:30 ` [patch 07/60] Move stfle to header file Martin Schwidefsky
2008-11-27 10:30 ` [patch 08/60] zcrypt: Use of Thin Interrupts Martin Schwidefsky
2008-11-27 10:30 ` [patch 09/60] ap: Minor code beautification Martin Schwidefsky
2008-11-27 10:30 ` [patch 10/60] qdio: fix qeth port count detection Martin Schwidefsky
2008-11-27 10:30 ` [patch 11/60] qdio: add eqbs/sqbs instruction counters Martin Schwidefsky
2008-11-27 10:30 ` [patch 12/60] qdio: fix compile warning under 31 bit Martin Schwidefsky
2008-11-27 10:30 ` [patch 13/60] qdio: rework debug feature logging Martin Schwidefsky
2008-11-27 10:30 ` [patch 14/60] qdio: improve error handling for unexpected buffer states Martin Schwidefsky
2008-11-27 10:30 ` [patch 15/60] qdio: improve inbound buffer acknowledgement Martin Schwidefsky
2008-11-27 10:30 ` [patch 16/60] service level interface Martin Schwidefsky
2008-11-27 10:30 ` [patch 17/60] zfcp: Report microcode level through " Martin Schwidefsky
2008-11-27 10:30 ` Martin Schwidefsky [this message]
2008-11-27 10:30 ` [patch 19/60] struct device - replace bus_id with dev_name(), dev_set_name() Martin Schwidefsky
2008-11-27 10:30 ` [patch 20/60] iucv: Locking free version of iucv_message_(receive|send) Martin Schwidefsky
2008-11-27 10:30 ` [patch 21/60] s390/hvc_console: z/VM IUCV hypervisor console support Martin Schwidefsky
2008-11-27 10:30 ` [patch 22/60] ftrace: function tracer backend for s390 Martin Schwidefsky
2008-11-27 10:30 ` [patch 23/60] __page_to_pfn warnings Martin Schwidefsky
2008-11-27 10:30 ` [patch 24/60] remove ptrace warning on 31 bit Martin Schwidefsky
2008-11-27 10:30 ` [patch 25/60] cio: get rid of compile warning Martin Schwidefsky
2008-11-27 10:30 ` [patch 26/60] mark disabled_wait as noreturn function Martin Schwidefsky
2008-11-27 10:30 ` [patch 27/60] remove warnings with functions ending in BUG Martin Schwidefsky
2008-11-27 10:30 ` [patch 28/60] sclp vt220: fix compile warning Martin Schwidefsky
2008-11-27 10:30 ` [patch 29/60] Add processor type march=z10 and a processor type safety check Martin Schwidefsky
2008-11-27 10:30 ` [patch 30/60] dasd: Use accessors instead of using driver_data directly Martin Schwidefsky
2008-11-27 10:30 ` [patch 31/60] cio: update sac values Martin Schwidefsky
2008-11-27 10:30 ` [patch 32/60] Remove initial kernel stack backchain initialization Martin Schwidefsky
2008-11-27 10:30 ` [patch 33/60] cio: move irritating comment Martin Schwidefsky
2008-11-27 10:30 ` [patch 34/60] add new machine types to setup_hwcaps Martin Schwidefsky
2008-11-27 10:30 ` [patch 35/60] convert xpram printks to pr_xxx macros Martin Schwidefsky
2008-11-27 10:30 ` [patch 36/60] convert vmcp " Martin Schwidefsky
2008-11-27 10:30 ` [patch 37/60] convert lcs printks to dev_xxx and " Martin Schwidefsky
2008-11-27 10:30 ` [patch 38/60] convert cpcmd printks to " Martin Schwidefsky
2008-11-27 10:30 ` [patch 39/60] convert vmur " Martin Schwidefsky
2008-11-27 10:31 ` [patch 40/60] convert cio " Martin Schwidefsky
2008-11-27 10:31 ` [patch 41/60] convert cpacf " Martin Schwidefsky
2008-11-27 10:31 ` [patch 42/60] convert time " Martin Schwidefsky
2008-11-27 10:31 ` [patch 43/60] convert hypfs " Martin Schwidefsky
2008-11-27 10:31 ` [patch 44/60] convert setup " Martin Schwidefsky
2008-11-27 10:31 ` [patch 45/60] convert appldata " Martin Schwidefsky
2008-11-27 10:31 ` [patch 46/60] convert monreader " Martin Schwidefsky
2008-11-27 10:31 ` [patch 47/60] convert s390 debug feature " Martin Schwidefsky
2008-11-27 10:31 ` [patch 48/60] convert monwriter " Martin Schwidefsky
2008-11-27 10:31 ` [patch 49/60] convert dcssblk and extmem printks messages " Martin Schwidefsky
2008-11-27 10:31 ` [patch 50/60] convert ap_bus printks " Martin Schwidefsky
2008-11-27 10:31 ` [patch 51/60] convert iucv printks to dev_xxx and " Martin Schwidefsky
2008-11-27 10:31 ` [patch 52/60] convert sclp printks to " Martin Schwidefsky
2008-11-27 10:31 ` [patch 53/60] convert qeth printks to dev_xxx and " Martin Schwidefsky
2008-11-27 10:31 ` [patch 54/60] convert cpu related printks to " Martin Schwidefsky
2008-11-27 10:31 ` [patch 55/60] convert zfcp dumper " Martin Schwidefsky
2008-11-27 10:31 ` [patch 56/60] convert vmlogrdr " Martin Schwidefsky
2008-11-27 10:31 ` [patch 57/60] convert zfcp " Martin Schwidefsky
2008-11-27 10:31 ` [patch 58/60] convert ctcm printks to dev_xxx and " Martin Schwidefsky
2008-11-27 10:31 ` [patch 59/60] provide documentation for hvc_iucv printk & kernel parameter Martin Schwidefsky
2008-11-27 10:31 ` [patch 60/60] tape message cleanup Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081127103132.813255499@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=stefan.haberland@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.