source: rtems/testsuites/tmtests/include/timesys.h @ 2ead50a

4.11
Last change on this file since 2ead50a was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 *  @file
3 *  @brief Timing Test Support
4 *
5 *  This header file contains supporting definitions for the
6 *  Timing Test Suites.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2013.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#include <tmacros.h>
19#include <inttypes.h>
20
21/*
22 *  This constant determines the maximum number of a resource
23 *  that will be created.  For example, some test create multiple
24 *  blocking tasks to determine the execution time of blocking
25 *  services.  By default, the blocking time of 100 tasks will
26 *  be measured.  Small targets often do not have enough memory
27 *  to create 100 tasks.  By overriding the default OPERATION_COUNT
28 *  with a lower number (typically 10 or less), all of the time tests
29 *  can usually be run.  This is stil not very fine-grained but
30 *  is enough to significantly reduce memory consumption.
31 */
32
33#ifndef OPERATION_COUNT
34#define OPERATION_COUNT 100
35#endif
36
37/* functions */
38
39#define put_time( _message, _total_time, \
40                  _iterations, _loop_overhead, _overhead ) \
41    printf( \
42      "%s - %" PRId32 "\n", \
43      (_message), \
44      (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \
45    )
46
47#if  defined(CONFIGURE_STACK_CHECKER_ENABLED) || defined(RTEMS_DEBUG)
48#define Print_Warning() \
49  do { \
50    puts( \
51      "\n" \
52      "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \
53      "\n" \
54    ); \
55  } while (0)
56
57#else
58#define Print_Warning()
59#endif
60
61/* variables */
62
63TEST_EXTERN volatile uint32_t   end_time;   /* ending time variable */
64TEST_EXTERN volatile uint32_t   overhead;   /* loop overhead variable */
65
66/* end of include file */
Note: See TracBrowser for help on using the repository browser.