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

4.115
Last change on this file since baef6771 was baef6771, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 15, 2011 at 2:34:21 PM

2011-09-15 Sebastian Huber <sebastian.huber@…>

  • cpukit/libmisc/cpuuse/cpuuse.h, cpukit/libmisc/cpuuse/cpuusagedata.c, cpukit/libmisc/cpuuse/cpuusagereport.c, cpukit/libmisc/cpuuse/cpuusagereset.c: Fixed timestamp usage.
  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[e49e84c9]1/*
2 *  CPU Usage Reporter
3 *
[dca9a82]4 *  COPYRIGHT (c) 1989-2009
[e49e84c9]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 <stdlib.h>
19#include <ctype.h>
20#include <inttypes.h>
21
22#include <rtems/cpuuse.h>
23
24static void CPU_usage_Per_thread_handler(
25  Thread_Control *the_thread
26)
27{
[c6f7e060]28  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
[c16bcc0]29    _Timestamp_Set_to_zero( &the_thread->cpu_time_used );
[e49e84c9]30  #else
[5fa5185]31    the_thread->cpu_time_used = 0;
[e49e84c9]32  #endif
33}
34
35/*
36 *  rtems_cpu_usage_reset
37 */
38void rtems_cpu_usage_reset( void )
39{
[c6f7e060]40  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
[793dd46]41    _TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset );
[3462c34]42    _Thread_Time_of_last_context_switch = CPU_usage_Uptime_at_last_reset;
[793dd46]43  #else
[e49e84c9]44    CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
45  #endif
46
47  rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler);
48}
Note: See TracBrowser for help on using the repository browser.