Changeset cf56b18a in rtems for testsuites


Ignore:
Timestamp:
02/02/18 06:48:08 (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
c1c71cd
Parents:
1e483a62
git-author:
Sebastian Huber <sebastian.huber@…> (02/02/18 06:48:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/02/18 06:50:19)
Message:

smpschededf01: Use rtems_test_busy_cpu_usage()

The rtems_test_busy() is not accurate enough and may lead to sporadic
test failures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpschededf01/init.c

    r1e483a62 rcf56b18a  
    11/*
    2  * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2017, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    2525
    2626typedef struct {
    27   uint_fast32_t one_tick_busy;
    2827  rtems_id task[2];
    2928} test_context;
     
    3130static test_context test_instance;
    3231
    33 static void t(test_context *ctx, rtems_interval p, uint_fast32_t c)
     32static void t(test_context *ctx, rtems_interval p, long nanoseconds)
    3433{
    3534  rtems_status_code sc;
    3635  rtems_id period;
    3736  rtems_name name;
    38   uint_fast32_t busy;
    3937
    4038  sc = rtems_object_get_classic_name(rtems_task_self(), &name);
     
    4442  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    4543
    46   busy = (c - 1) * ctx->one_tick_busy + (4 * ctx->one_tick_busy) / 5;
    47 
    4844  while (true) {
    49     rtems_test_busy(busy);
     45    rtems_test_busy_cpu_usage(0, nanoseconds);
    5046
    5147    sc = rtems_rate_monotonic_period(period, p);
     
    5854  test_context *ctx = (test_context *) arg;
    5955
    60   t(ctx, 50, 25);
     56  t(ctx, 50, 25000000);
    6157}
    6258
     
    6561  test_context *ctx = (test_context *) arg;
    6662
    67   t(ctx, 75, 30);
     63  t(ctx, 75, 30000000);
    6864}
    6965
     
    7167{
    7268  rtems_status_code sc;
    73 
    74   ctx->one_tick_busy = rtems_test_get_one_tick_busy_count();
    7569
    7670  sc = rtems_task_create(
Note: See TracChangeset for help on using the changeset viewer.