source: rtems/cpukit/libmisc/cpuuse/cpuusagereset.c @ e6b31b27

4.11
Last change on this file since e6b31b27 was e6b31b27, checked in by Joel Sherrill <joel.sherrill@…>, on May 27, 2015 at 3:13:58 PM

Remove use ticks for statistics configure option.

This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the RTEMS_USE_TICKS_FOR_STATISTICS conditional.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief CPU Usage Reset
5 * @ingroup libmisc_cpuuse CPU Usage
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2009
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/cpuuse.h>
22#include <rtems/score/thread.h>
23#include <rtems/score/todimpl.h>
24#include <rtems/score/watchdogimpl.h>
25
26static void CPU_usage_Per_thread_handler(
27  Thread_Control *the_thread
28)
29{
30  _Timestamp_Set_to_zero( &the_thread->cpu_time_used );
31}
32
33/*
34 *  rtems_cpu_usage_reset
35 */
36void rtems_cpu_usage_reset( void )
37{
38  uint32_t cpu_count;
39  uint32_t cpu_index;
40
41  _TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset );
42
43  cpu_count = rtems_get_processor_count();
44  for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
45    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
46
47    cpu->time_of_last_context_switch = CPU_usage_Uptime_at_last_reset;
48  }
49
50  rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler);
51}
Note: See TracBrowser for help on using the repository browser.