Sebastien Dugue wrote:
>   Hi,
> 
> On Thu,  6 Mar 2008 13:37:56 +0100 Gilles Carry <[EMAIL PROTECTED]> wrote:
> 
>>      - configurable criteria (-m argument)
> 
>   Maybe a lot of the realtime tests could benefit from such an addition.
> The criterion for PASS/FAIL should IMHO be configurable, it won't be the
> same for an embedded 57 MHz ARM7 or a 10.25GHz Power9. It will also depend
> on the RT goals the system has been designed for.

Completely agree.  In fact, I would prefer that the tests don't even have a 
criteria unless one is passed to them.  Or perhaps none at all, and they should 
only report results (unless they are a functional sort of test).  Then parsers 
can be written with a variety of user-generated profiles that report on if the 
results meet the requirements of the profile.

This would be a significant effort, and we should get as many people to chime 
in 
as possible before we start any implementation in this direction.

--
Darren

> 
>   Sebastien.
> 
>>      - configurable iterations
>>      - check stats init return codes
>>
>> Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
>> Cc: Darren Hart <[EMAIL PROTECTED]>
>> Cc: Tim Chavez <[EMAIL PROTECTED]>
>> ---
>>  .../realtime/func/hrtimer-prio/hrtimer-prio.c      |   32 
>> +++++++++++++------
>>  1 files changed, 22 insertions(+), 10 deletions(-)
>>
>> diff --git a/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c 
>> b/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c
>> index 3fdda64..f22ca83 100644
>> --- a/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c
>> +++ b/testcases/realtime/func/hrtimer-prio/hrtimer-prio.c
>> @@ -49,7 +49,7 @@
>>  #include <libjvmsim.h>
>>  #include <libstats.h>
>>  
>> -#define DEF_MED_PRIO 60             // (softirqd-hrtimer,98]
>> +#define DEF_MED_PRIO 60             // (softirqd-hrtimer,98)
>>  #define DEF_ITERATIONS 10000
>>  #define HIST_BUCKETS 100
>>  #define DEF_BUSY_TIME 10    // Duration of busy work in milliseconds
>> @@ -58,10 +58,10 @@
>>  
>>  static int run_jvmsim = 0;
>>  static int med_prio = DEF_MED_PRIO;
>> -static int high_prio = DEF_MED_PRIO+1;
>> +static int high_prio;
>>  static int busy_time = DEF_BUSY_TIME;
>>  static int iterations = DEF_ITERATIONS;
>> -static unsigned long criteria = DEF_CRITERIA;       // FIXME: make 
>> configurable
>> +static unsigned long criteria = DEF_CRITERIA;
>>  static int busy_threads;
>>  
>>  static stats_container_t dat;
>> @@ -78,6 +78,7 @@ void usage(void)
>>      printf("  -i#           #:number of iterations, defaults to %d\n", 
>> DEF_ITERATIONS);
>>      printf("  -n#           #:number of busy threads, defaults to 
>> NR_CPUS*2\n");
>>      printf("  -f#           #:rt fifo priority of busy threads (1,98), 
>> defaults to %d\n", DEF_MED_PRIO);
>> +    printf("  -m#           #:maximum timer latency in microseconds, 
>> defaults to %d\n", DEF_CRITERIA);
>>  }
>>  
>>  int parse_args(int c, char *v)
>> @@ -99,11 +100,12 @@ int parse_args(int c, char *v)
>>                      break;
>>              case 'f':
>>                      med_prio = MIN(atoi(v), 98);
>> -                    high_prio = med_prio+1;
>>                      break;
>>                  case 'i':
>> -                    printf("Setting iterations disabled\n");
>> -                     // iterations = atoi(v);
>> +                    iterations = atoi(v);
>> +                        break;
>> +                case 'm':
>> +                    criteria = atoi(v);
>>                          break;
>>                  default:
>>                          handled = 0;
>> @@ -155,7 +157,8 @@ int main(int argc, char *argv[])
>>      int t_id;
>>      setup();
>>      busy_threads = 2 * sysconf(_SC_NPROCESSORS_ONLN); // default 
>> busy_threads
>> -    rt_init("f:i:jhn:t:", parse_args, argc, argv);
>> +    rt_init("f:i:jhn:t:m:", parse_args, argc, argv);
>> +    high_prio = med_prio + 1;
>>  
>>      // Set main()'s prio to one above the timer_thread so it is sure to not
>>      // be starved
>> @@ -183,9 +186,18 @@ int main(int argc, char *argv[])
>>  
>>      stats_container_t hist;
>>      stats_quantiles_t quantiles;
>> -    stats_container_init(&dat, iterations);
>> -    stats_container_init(&hist, HIST_BUCKETS);
>> -    stats_quantiles_init(&quantiles, (int)log10(iterations));
>> +    if (stats_container_init(&dat, iterations)) {
>> +            printf("Cannot init stat containers for dat\n");
>> +            exit(1);
>> +    }
>> +    if (stats_container_init(&hist, HIST_BUCKETS)) {
>> +            printf("Cannot init stat containers for hist\n");
>> +            exit(1);
>> +    }
>> +    if (stats_quantiles_init(&quantiles, (int)log10(iterations))) {
>> +            printf("Cannot init stat quantiles\n");
>> +            exit(1);
>> +    }
>>  
>>      t_id = create_fifo_thread(timer_thread, NULL, high_prio);
>>      if (t_id == -1) {
>> -- 
>> 1.5.4.3.450.gb92176
>>
>>


-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to