source: rtems/cpukit/rtems/src/ratemonresetall.c @ c3330a8

4.104.114.84.95
Last change on this file since c3330a8 was c3330a8, checked in by Joel Sherrill <joel.sherrill@…>, on 05/17/07 at 22:46:45

2007-05-17 Joel Sherrill <joel.sherrill@…>

  • ChangeLog?, configure.ac, libcsupport/src/times.c, libmisc/cpuuse/cpuuse.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c, rtems/src/ratemonreportstatistics.c, rtems/src/ratemonresetall.c, rtems/src/ratemontimeout.c, score/Makefile.am, score/include/rtems/score/thread.h, score/include/rtems/score/timespec.h, score/src/threaddispatch.c, score/src/threadinitialize.c, score/src/threadtickletimeslice.c, score/src/timespecdivide.c: Add nanoseconds granularity to the rate monotonic period statistics and CPU usage statistics. This capability is enabled by default although may be conditionally disabled by the user. It could be too much overhead on small targets but it does not appear to be bad in early testing. Its impact on code size has not been evaluated either. It is possible that both forms of statistics gathering could be disabled with further tweaking of the conditional compilation.
  • score/src/timespecdividebyinteger.c: New file.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Rate Monotonic Manager -- Reset Statistics for All Periods
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/rtems/status.h>
20#include <rtems/rtems/support.h>
21#include <rtems/score/object.h>
22#include <rtems/rtems/ratemon.h>
23#include <rtems/score/thread.h>
24
25/*
26 *  rtems_rate_monotonic_reset_all_statistics
27 */
28void rtems_rate_monotonic_reset_all_statistics( void )
29{
30  Objects_Id        id;
31  rtems_status_code status;
32
33   /*
34    *  Prevent allocation or deallocation of any of the periods while
35    *  we are cycling.  Also this is an optimization which ensures that
36    *  we only disable/enable once.  The call to
37    *  rtems_rate_monotonic_reset_statistics will be in a nested dispatch
38    *  disabled critical section.
39    */
40  _Thread_Disable_dispatch();
41
42    /*
43     * Cycle through all possible ids and try to reset each one.  If it
44     * is a period that is inactive, we just get an error back.  No big deal.
45     */
46    for ( id=_Rate_monotonic_Information.minimum_id ;
47          id <= _Rate_monotonic_Information.maximum_id ;
48          id++ ) {
49      status = rtems_rate_monotonic_reset_statistics( id );
50    }
51
52  /*
53   *  Done so exit thread dispatching disabled critical section.
54   */
55  _Thread_Enable_dispatch();
56}
Note: See TracBrowser for help on using the repository browser.