patch-2.0.11 linux/drivers/scsi/eata_dma_proc.c
Next file: linux/drivers/scsi/eata_generic.h
Previous file: linux/drivers/scsi/eata_dma.h
Back to the patch index
Back to the overall index
- Lines: 186
- Date:
Thu Aug 1 15:43:04 1996
- Orig file:
v2.0.10/linux/drivers/scsi/eata_dma_proc.c
- Orig date:
Fri Apr 12 09:49:41 1996
diff -u --recursive --new-file v2.0.10/linux/drivers/scsi/eata_dma_proc.c linux/drivers/scsi/eata_dma_proc.c
@@ -295,63 +295,66 @@
}
if (pos > offset + length)
goto stop_output;
-
- cmnd[0] = LOG_SENSE;
- cmnd[1] = 0;
- cmnd[2] = 0x32 + (3<<6);
- cmnd[3] = 0;
- cmnd[4] = 0;
- cmnd[5] = 0;
- cmnd[6] = 0;
- cmnd[7] = 0x01;
- cmnd[8] = 0x44;
- cmnd[9] = 0;
-
- scmd.cmd_len = 10;
-
- /*
- * Do the command and wait for it to finish.
- */
- {
- struct semaphore sem = MUTEX_LOCKED;
- scmd.request.rq_status = RQ_SCSI_BUSY;
- scmd.request.sem = &sem;
- scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
- eata_scsi_done, 1 * HZ, 1);
- down(&sem);
- }
- swap_statistics(buff2);
- rhcs = (hst_cmd_stat *)(buff2 + 0x2c);
- whcs = (hst_cmd_stat *)(buff2 + 0x8c);
-
- for (x = 0; x <= 11; x++) {
- SD(HBA_ptr)->reads[x] += rhcs->sizes[x];
- SD(HBA_ptr)->writes[x] += whcs->sizes[x];
- SD(HBA_ptr)->reads[12] += rhcs->sizes[x];
- SD(HBA_ptr)->writes[12] += whcs->sizes[x];
- }
- size = sprintf(buffer + len, "Host<->Disk command statistics:\n"
- " Reads: Writes:\n");
- len += size;
- pos = begin + len;
- for (x = 0; x <= 10; x++) {
- size = sprintf(buffer+len,"%5dk:%12u %12u\n", 1 << x,
- SD(HBA_ptr)->reads[x],
- SD(HBA_ptr)->writes[x]);
+ if(SD(HBA_ptr)->do_latency == FALSE) {
+
+ cmnd[0] = LOG_SENSE;
+ cmnd[1] = 0;
+ cmnd[2] = 0x32 + (3<<6);
+ cmnd[3] = 0;
+ cmnd[4] = 0;
+ cmnd[5] = 0;
+ cmnd[6] = 0;
+ cmnd[7] = 0x01;
+ cmnd[8] = 0x44;
+ cmnd[9] = 0;
+
+ scmd.cmd_len = 10;
+
+ /*
+ * Do the command and wait for it to finish.
+ */
+ {
+ struct semaphore sem = MUTEX_LOCKED;
+ scmd.request.rq_status = RQ_SCSI_BUSY;
+ scmd.request.sem = &sem;
+ scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
+ eata_scsi_done, 1 * HZ, 1);
+ down(&sem);
+ }
+
+ swap_statistics(buff2);
+ rhcs = (hst_cmd_stat *)(buff2 + 0x2c);
+ whcs = (hst_cmd_stat *)(buff2 + 0x8c);
+
+ for (x = 0; x <= 11; x++) {
+ SD(HBA_ptr)->reads[x] += rhcs->sizes[x];
+ SD(HBA_ptr)->writes[x] += whcs->sizes[x];
+ SD(HBA_ptr)->reads[12] += rhcs->sizes[x];
+ SD(HBA_ptr)->writes[12] += whcs->sizes[x];
+ }
+ size = sprintf(buffer + len, "Host<->Disk command statistics:\n"
+ " Reads: Writes:\n");
+ len += size;
+ pos = begin + len;
+ for (x = 0; x <= 10; x++) {
+ size = sprintf(buffer+len,"%5dk:%12u %12u\n", 1 << x,
+ SD(HBA_ptr)->reads[x],
+ SD(HBA_ptr)->writes[x]);
+ len += size;
+ pos = begin + len;
+ }
+ size = sprintf(buffer+len,">1024k:%12u %12u\n",
+ SD(HBA_ptr)->reads[11],
+ SD(HBA_ptr)->writes[11]);
+ len += size;
+ pos = begin + len;
+ size = sprintf(buffer+len,"Sum :%12u %12u\n",
+ SD(HBA_ptr)->reads[12],
+ SD(HBA_ptr)->writes[12]);
len += size;
pos = begin + len;
}
- size = sprintf(buffer+len,">1024k:%12u %12u\n",
- SD(HBA_ptr)->reads[11],
- SD(HBA_ptr)->writes[11]);
- len += size;
- pos = begin + len;
- size = sprintf(buffer+len,"Sum :%12u %12u\n",
- SD(HBA_ptr)->reads[12],
- SD(HBA_ptr)->writes[12]);
- len += size;
- pos = begin + len;
}
if (pos < offset) {
@@ -362,9 +365,11 @@
goto stop_output;
if(SD(HBA_ptr)->do_latency == TRUE) {
+ int factor = 1024/HZ;
size = sprintf(buffer + len, "Host Latency Command Statistics:\n"
- "Current timer resolution: 10ms\n"
- " Reads: Min:(ms) Max:(ms) Ave:(ms)\n");
+ "Current timer resolution: %2dms\n"
+ " Reads: Min:(ms) Max:(ms) Ave:(ms)\n",
+ factor);
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
@@ -372,9 +377,9 @@
1 << x,
SD(HBA_ptr)->reads_lat[x][0],
(SD(HBA_ptr)->reads_lat[x][1] == 0xffffffff)
- ? 0:(SD(HBA_ptr)->reads_lat[x][1] * 10),
- SD(HBA_ptr)->reads_lat[x][2] * 10,
- SD(HBA_ptr)->reads_lat[x][3] * 10 /
+ ? 0:(SD(HBA_ptr)->reads_lat[x][1] * factor),
+ SD(HBA_ptr)->reads_lat[x][2] * factor,
+ SD(HBA_ptr)->reads_lat[x][3] * factor /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
@@ -383,9 +388,9 @@
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->reads_lat[11][0],
(SD(HBA_ptr)->reads_lat[11][1] == 0xffffffff)
- ? 0:(SD(HBA_ptr)->reads_lat[11][1] * 10),
- SD(HBA_ptr)->reads_lat[11][2] * 10,
- SD(HBA_ptr)->reads_lat[11][3] * 10 /
+ ? 0:(SD(HBA_ptr)->reads_lat[11][1] * factor),
+ SD(HBA_ptr)->reads_lat[11][2] * factor,
+ SD(HBA_ptr)->reads_lat[11][3] * factor /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
@@ -407,9 +412,9 @@
1 << x,
SD(HBA_ptr)->writes_lat[x][0],
(SD(HBA_ptr)->writes_lat[x][1] == 0xffffffff)
- ? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
- SD(HBA_ptr)->writes_lat[x][2] * 10,
- SD(HBA_ptr)->writes_lat[x][3] * 10 /
+ ? 0:(SD(HBA_ptr)->writes_lat[x][1] * factor),
+ SD(HBA_ptr)->writes_lat[x][2] * factor,
+ SD(HBA_ptr)->writes_lat[x][3] * factor /
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
@@ -418,9 +423,9 @@
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->writes_lat[11][0],
(SD(HBA_ptr)->writes_lat[11][1] == 0xffffffff)
- ? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
- SD(HBA_ptr)->writes_lat[11][2] * 10,
- SD(HBA_ptr)->writes_lat[11][3] * 10/
+ ? 0:(SD(HBA_ptr)->writes_lat[x][1] * factor),
+ SD(HBA_ptr)->writes_lat[11][2] * factor,
+ SD(HBA_ptr)->writes_lat[11][3] * factor /
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov