|
|
1.1 root 1:
2: #include "vdfmt.h"
3:
4: #define cycles 10
5:
6: /*
7: **
8: */
9:
10: profile()
11: {
12: unsigned int total_time, i, step, remainder;
13: dskadr ead, zero;
14: char digit_buf[20];
15:
16: print("Disk seek profile for ");
17: printf("controller %d, drive %d, ", cur.controller, cur.drive);
18: printf("type %s.\n",CURRENT->type_name);
19:
20: indent();
21: if(is_formatted() == false) {
22: print("Can not profile unformatted drives!\n");
23: _longjmp(abort_environ, 1);
24: }
25: print(" Seek | Seek time (ms)\n");
26: print("Length |0 5 10 15 20 25 30 35 40 45 50\n");
27: print("-------|-----+----+----+----+----+----+----+----+----+----+\n");
28:
29: cur.state = prof;
30: zero.cylinder = zero.track = zero.sector=0;
31: ead.track = ead.sector=0;
32: step = CURRENT->ncyl / 55;
33: for(ead.cylinder=1; ead.cylinder<CURRENT->ncyl; ead.cylinder+=step){
34: total_time = 0;
35: for(i=0; i<cycles; i++) {
36: access_dsk((char *)save, &zero, SEEK, 1, 60);
37: access_dsk((char *)save, &ead, SEEK, 1, 60);
38: if(kill_processes == true)
39: _longjmp(quit_environ, 1);
40: total_time += ((2*60*1000*1000) - vdtimeout);
41: }
42: print("");
43: sprintf(digit_buf, "%d ", ead.cylinder);
44: for(i=0; i<7; i++)
45: putchar(digit_buf[i]);
46: putchar('|');
47: total_time /= cycles;
48: remainder = total_time % 10;
49: total_time /= 10;
50: while(total_time--)
51: putchar(' ');
52: if(remainder >= 5)
53: printf("+\n");
54: else
55: printf("*\n");
56: DELAY(400000);
57: }
58: print("-------|-----+----+----+----+----+----+----+----+----+----+\n");
59: print(" |0 5 10 15 20 25 30 35 40 45 50\n");
60: exdent(1);
61: printf("Profile completed successfully.\n");
62: }
63:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.