﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
347	instr_speed does not work if the system is much slower than expected.	trnsz@…	Eric Swenson	"In the recent past, we fixed instr_speed to properly display large numbers (if the system was very past).  This fixes the opposite problem, that is, allows instr_speed to run if the system is too slow.

The instr_speed program (see https://dps8m.gitlab.io/sb/MR12.8/library_dir_dir/system_library_tools/source/bound_system_test_.s.archive/instr_speed.pl1.html) checks for large samples, and if a large sample is encountered, it will continue to loop.  This becomes an infinite loop is all samples are large samples.

The following patch to the instr_speed.pl1 program changes the logic to continue on if five large samples are encountered. Please excuse my non-standard indentation.

-------------------------------------------------


{{{
cpa instr_speed.pl1 instr_speed_1.pl1

A132                     do while (successes < NUMPASSES);            /* loop until get 100 good runs */
A133                          call test_speed (type, time, ls, maxs, pf, count, temp_p); /* run a test for this type */
A134                          if pf > 0 then pf_aborts = pf_aborts + 1; /* took a page fault, skip this one */
A135                          else if ls > 0 then ls_aborts = ls_aborts + 1; /* took a large sample (probable interrupt) */
A136                          else do;
A137                               successes = successes + 1;         /* another successful run */
A138                               time_total = time_total + float (time);
A139                               mips = float (count) / float (time); /* get mips for this run */
A140                               bucket = mips * INDEX_FACTOR;                /* get the index into hist for this run */
A141                               bucket = min (bucket, MAXHIST);    /* watch out for overflow */
A142                               bucketmax = max (bucketmax, bucket); /* calculate bounds of possible values for this type */
A143                               bucketmin = min (bucketmin, bucket); /* .. */
A144                               hist (bucket) = hist (bucket) + 1; /* fill in histogram */
A145                               mips_total = mips_total + mips;    /* keep running total for final ave */
A146                          end;
A147                     end;
A148
Changed by B to:
B132
B133      do while (successes < NUMPASSES);           /* loop until get 100 good runs */
B134           call test_speed (type, time, ls, maxs, pf, count, temp_p); /* run a test for this type */
B135           if pf > 0 then pf_aborts = pf_aborts + 1; /* took a page fault, skip this one */
B136           else if ls > 0 then do; /* took a large sample (probable interrupt) */
B137                if ls_aborts < 5 then ls_aborts = ls_aborts + 1; /* increment ls_aborts up to 5 */
B138                else goto process_success; /* continue if ls_aborts >= 5 */
B139           end;
B140           else goto process_success; /* handle successful run if no page fault or large sample */
B141           next_iteration:
B142      end;
B143
B144      goto continue_on;
B145      process_success:
B146           successes = successes + 1;        /* another successful run */
B147           time_total = time_total + float (time);
B148           mips = float (count) / float (time); /* get mips for this run */
B149           bucket = mips * INDEX_FACTOR;           /* get the index into hist for this run */
B150           bucket = min (bucket, MAXHIST);   /* watch out for overflow */
B151           bucketmax = max (bucketmax, bucket); /* calculate bounds of possible values for this type */
B152           bucketmin = min (bucketmin, bucket); /* .. */
B153           hist (bucket) = hist (bucket) + 1; /* fill in histogram */
B154           mips_total = mips_total + mips;   /* keep running total for final ave */
B155           goto next_iteration;


Inserted in B:
B158      continue_on:
Preceding:
A151                     call ioa_ (""^/* * * * * * * * * * * * * * * * * * * * * *^/"");

Comparison finished: 2 differences, 42 lines.

}}}

This allows instr_speed to run on *VERY* slow systems, for example:

-------------------------------------------------

{{{

INSTRUCTION SPEED TEST -- 01/25/25  0028.5 pst Sat
                                                            

* * * * * * * * * * * * * * * * * * * * * *


TEST 1: (lda/sta - even/odd)                                

MIPS AVE =  0.202, TIME AVE = 5164, 4950 NANOSECONDS

* * * * * * * * * * * * * * * * * * * * * *


TEST 2: (lda/sta - odd/even)                                

MIPS AVE =  0.200, TIME AVE = 5223, 5010 NANOSECONDS

* * * * * * * * * * * * * * * * * * * * * *
 
[ ... snip ... ]
}}}

-------------------------------------------------

An additional enhancement would be to print a warning message when the ls_aborts limit is encountered."	defect	closed	minor	MR12.9	Administration	MR12.8	fixed		eric@…
