Changeset e49e84c9 in rtems


Ignore:
Timestamp:
May 21, 2007, 8:28:02 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
6f1384c
Parents:
a205b96b
Message:

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

  • libmisc/Makefile.am, libmisc/cpuuse/README: Split remaining CPU Usage functionality into multiple files to eliminate unnecessary cohesion. Update README.
  • libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c: New files.
  • libmisc/cpuuse/cpuuse.c: Removed.
Location:
cpukit
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    ra205b96b re49e84c9  
     12007-05-21      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libmisc/Makefile.am, libmisc/cpuuse/README: Split remaining CPU Usage
     4        functionality into multiple files to eliminate unnecessary cohesion.
     5        Update README.
     6        * libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c:
     7        New files.
     8        * libmisc/cpuuse/cpuuse.c: Removed.
     9
    1102007-05-21      Joel Sherrill <joel.sherrill@oarcorp.com>
    211
  • cpukit/libmisc/Makefile.am

    ra205b96b re49e84c9  
    2020
    2121noinst_LIBRARIES += libcpuuse.a
    22 libcpuuse_a_SOURCES = cpuuse/cpuuse.c cpuuse/cpuuse.h
     22libcpuuse_a_SOURCES = cpuuse/cpuusagereport.c cpuuse/cpuusagereset.c \
     23    cpuuse/cpuuse.h
    2324
    2425## devnull
  • cpukit/libmisc/cpuuse/README

    ra205b96b re49e84c9  
    33#
    44
    5 This directory contains a CPU usage reported.  It provides two
    6 primary features:
     5This directory contains code to report and reset per-task CPU usage.
     6If the BSP supports nanosecond timestamp granularity, this this information
     7is very accurate.  Otherwise, it is dependendent on the tick granularity.
    78
    8    + provides an educated guess at each task's CPU usage
     9It provides two primary features:
     10
     11  + Generate a CPU Usage Report
     12  + Reset CPU Usage Information
    913
    1014NOTES:
    1115
    12 1.  CPU usage is "docked" by a clock tick at each context switch.
     161.  If configured for tick granularity, CPU usage is "docked" by a
     17    clock tick at each context switch.
     182.  If configured for nanosecond granularity, no work is done at each
     19    clock tick.  All bookkeeping is done as part of a context switch.
    1320
    1421
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    ra205b96b re49e84c9  
    8383 
    8484  printk( "CPU Usage by thread\n"
     85    #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
     86          "   ID        NAME    SECONDS   PERCENT\n"
     87    #else
    8588          "   ID        NAME     TICKS    PERCENT\n"
     89    #endif
    8690  );
    8791
     
    144148  #endif
    145149}
    146 
    147 static void CPU_usage_Per_thread_handler(
    148   Thread_Control *the_thread
    149 )
    150 {
    151   #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
    152     the_thread->cpu_time_used.tv_sec  = 0;
    153     the_thread->cpu_time_used.tv_nsec = 0;
    154   #else
    155     the_thread->ticks_executed = 0;
    156   #endif
    157 }
    158 
    159 /*
    160  *  rtems_cpu_usage_reset
    161  */
    162 void rtems_cpu_usage_reset( void )
    163 {
    164   #ifndef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS
    165     CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
    166   #endif
    167 
    168   rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler);
    169 }
Note: See TracChangeset for help on using the changeset viewer.