aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd_proc.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 9088de84b45d..bf6fd348f20e 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -180,12 +180,12 @@ dasd_calc_metrics(char *page, char **start, off_t off,
180 180
181#ifdef CONFIG_DASD_PROFILE 181#ifdef CONFIG_DASD_PROFILE
182static char * 182static char *
183dasd_statistics_array(char *str, unsigned int *array, int shift) 183dasd_statistics_array(char *str, unsigned int *array, int factor)
184{ 184{
185 int i; 185 int i;
186 186
187 for (i = 0; i < 32; i++) { 187 for (i = 0; i < 32; i++) {
188 str += sprintf(str, "%7d ", array[i] >> shift); 188 str += sprintf(str, "%7d ", array[i] / factor);
189 if (i == 15) 189 if (i == 15)
190 str += sprintf(str, "\n"); 190 str += sprintf(str, "\n");
191 } 191 }
@@ -202,7 +202,7 @@ dasd_statistics_read(char *page, char **start, off_t off,
202#ifdef CONFIG_DASD_PROFILE 202#ifdef CONFIG_DASD_PROFILE
203 struct dasd_profile_info_t *prof; 203 struct dasd_profile_info_t *prof;
204 char *str; 204 char *str;
205 int shift; 205 int factor;
206 206
207 /* check for active profiling */ 207 /* check for active profiling */
208 if (dasd_profile_level == DASD_PROFILE_OFF) { 208 if (dasd_profile_level == DASD_PROFILE_OFF) {
@@ -214,12 +214,14 @@ dasd_statistics_read(char *page, char **start, off_t off,
214 214
215 prof = &dasd_global_profile; 215 prof = &dasd_global_profile;
216 /* prevent couter 'overflow' on output */ 216 /* prevent couter 'overflow' on output */
217 for (shift = 0; (prof->dasd_io_reqs >> shift) > 9999999; shift++); 217 for (factor = 1; (prof->dasd_io_reqs / factor) > 9999999;
218 factor *= 10);
218 219
219 str = page; 220 str = page;
220 str += sprintf(str, "%d dasd I/O requests\n", prof->dasd_io_reqs); 221 str += sprintf(str, "%d dasd I/O requests\n", prof->dasd_io_reqs);
221 str += sprintf(str, "with %d sectors(512B each)\n", 222 str += sprintf(str, "with %u sectors(512B each)\n",
222 prof->dasd_io_sects); 223 prof->dasd_io_sects);
224 str += sprintf(str, "Scale Factor is %d\n", factor);
223 str += sprintf(str, 225 str += sprintf(str,
224 " __<4 ___8 __16 __32 __64 _128 " 226 " __<4 ___8 __16 __32 __64 _128 "
225 " _256 _512 __1k __2k __4k __8k " 227 " _256 _512 __1k __2k __4k __8k "
@@ -230,22 +232,22 @@ dasd_statistics_read(char *page, char **start, off_t off,
230 " __1G __2G __4G " " _>4G\n"); 232 " __1G __2G __4G " " _>4G\n");
231 233
232 str += sprintf(str, "Histogram of sizes (512B secs)\n"); 234 str += sprintf(str, "Histogram of sizes (512B secs)\n");
233 str = dasd_statistics_array(str, prof->dasd_io_secs, shift); 235 str = dasd_statistics_array(str, prof->dasd_io_secs, factor);
234 str += sprintf(str, "Histogram of I/O times (microseconds)\n"); 236 str += sprintf(str, "Histogram of I/O times (microseconds)\n");
235 str = dasd_statistics_array(str, prof->dasd_io_times, shift); 237 str = dasd_statistics_array(str, prof->dasd_io_times, factor);
236 str += sprintf(str, "Histogram of I/O times per sector\n"); 238 str += sprintf(str, "Histogram of I/O times per sector\n");
237 str = dasd_statistics_array(str, prof->dasd_io_timps, shift); 239 str = dasd_statistics_array(str, prof->dasd_io_timps, factor);
238 str += sprintf(str, "Histogram of I/O time till ssch\n"); 240 str += sprintf(str, "Histogram of I/O time till ssch\n");
239 str = dasd_statistics_array(str, prof->dasd_io_time1, shift); 241 str = dasd_statistics_array(str, prof->dasd_io_time1, factor);
240 str += sprintf(str, "Histogram of I/O time between ssch and irq\n"); 242 str += sprintf(str, "Histogram of I/O time between ssch and irq\n");
241 str = dasd_statistics_array(str, prof->dasd_io_time2, shift); 243 str = dasd_statistics_array(str, prof->dasd_io_time2, factor);
242 str += sprintf(str, "Histogram of I/O time between ssch " 244 str += sprintf(str, "Histogram of I/O time between ssch "
243 "and irq per sector\n"); 245 "and irq per sector\n");
244 str = dasd_statistics_array(str, prof->dasd_io_time2ps, shift); 246 str = dasd_statistics_array(str, prof->dasd_io_time2ps, factor);
245 str += sprintf(str, "Histogram of I/O time between irq and end\n"); 247 str += sprintf(str, "Histogram of I/O time between irq and end\n");
246 str = dasd_statistics_array(str, prof->dasd_io_time3, shift); 248 str = dasd_statistics_array(str, prof->dasd_io_time3, factor);
247 str += sprintf(str, "# of req in chanq at enqueuing (1..32) \n"); 249 str += sprintf(str, "# of req in chanq at enqueuing (1..32) \n");
248 str = dasd_statistics_array(str, prof->dasd_io_nr_req, shift); 250 str = dasd_statistics_array(str, prof->dasd_io_nr_req, factor);
249 len = str - page; 251 len = str - page;
250#else 252#else
251 len = sprintf(page, "Statistics are not activated in this kernel\n"); 253 len = sprintf(page, "Statistics are not activated in this kernel\n");