1 #ifndef lint
2 static char sccsid[] = "@(#)profile.c 1.3 (Berkeley/CCI) 11/23/87";
3 #endif
4
5
6 #include "vdfmt.h"
7
8 #define cycles 10
9
10 /*
11 **
12 */
13
profile()14 profile()
15 {
16 unsigned int total_time, i, step, remainder;
17 dskadr ead, zero;
18 char digit_buf[20];
19
20 print("Disk seek profile for ");
21 printf("controller %d, drive %d, ", cur.controller, cur.drive);
22 printf("type %s.\n", lab->d_typename);
23
24 indent();
25 if(is_formatted() == false) {
26 print("Can not profile unformatted drives!\n");
27 _longjmp(abort_environ, 1);
28 }
29 print(" Seek | Seek time (ms)\n");
30 print("Length |0 5 10 15 20 25 30 35 40 45 50\n");
31 print("-------|-----+----+----+----+----+----+----+----+----+----+\n");
32
33 cur.state = prof;
34 zero.cylinder = zero.track = zero.sector=0;
35 ead.track = ead.sector=0;
36 step = lab->d_ncylinders / 55;
37 for(ead.cylinder=1; ead.cylinder<lab->d_ncylinders; ead.cylinder+=step){
38 total_time = 0;
39 for(i=0; i<cycles; i++) {
40 access_dsk((char *)save, &zero, VDOP_SEEK, 1, 60);
41 access_dsk((char *)save, &ead, VDOP_SEEK, 1, 60);
42 if(kill_processes == true)
43 _longjmp(quit_environ, 1);
44 total_time += ((2*60*1000*1000) - vdtimeout);
45 }
46 print("");
47 sprintf(digit_buf, "%d ", ead.cylinder);
48 for(i=0; i<7; i++)
49 putchar(digit_buf[i]);
50 putchar('|');
51 total_time /= cycles;
52 remainder = total_time % 10;
53 total_time /= 10;
54 while(total_time--)
55 putchar(' ');
56 if(remainder >= 5)
57 printf("+\n");
58 else
59 printf("*\n");
60 DELAY(400000);
61 }
62 print("-------|-----+----+----+----+----+----+----+----+----+----+\n");
63 print(" |0 5 10 15 20 25 30 35 40 45 50\n");
64 exdent(1);
65 printf("Profile completed successfully.\n");
66 }
67
68