mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 07:38:45 +08:00
2003-08-14 Joel Sherrill <joel@OARcorp.com>
PR 408/filesystem * cpuuse/cpuuse.c: Added sync() service. As part of adding this service, the new RTEMS service rtems_iterate_over_all_threads() was also added. This new service makes it easier to iterate over all the tasks/threads in a system and perform an action on them. This change is to use the new thread iteration service.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2003-08-14 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 408/filesystem
|
||||
* cpuuse/cpuuse.c: Added sync() service. As part of adding this
|
||||
service, the new RTEMS service rtems_iterate_over_all_threads() was
|
||||
also added. This new service makes it easier to iterate over all the
|
||||
tasks/threads in a system and perform an action on them. This change
|
||||
is to use the new thread iteration service.
|
||||
|
||||
2003-08-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* fsmount/Makefile.am: Fix path to automake-includes.
|
||||
|
||||
@@ -127,32 +127,17 @@ void CPU_usage_Dump( void )
|
||||
* CPU_usage_Reset
|
||||
*/
|
||||
|
||||
void CPU_usage_Reset( void )
|
||||
static void CPU_usage_Per_thread_handler(
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
unsigned32 i;
|
||||
unsigned32 api_index;
|
||||
Thread_Control *the_thread;
|
||||
Objects_Information *information;
|
||||
|
||||
CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
|
||||
|
||||
for ( api_index = 1 ;
|
||||
api_index <= OBJECTS_APIS_LAST ;
|
||||
api_index++ ) {
|
||||
if ( !_Objects_Information_table[ api_index ] )
|
||||
continue;
|
||||
information = _Objects_Information_table[ api_index ][ 1 ];
|
||||
if ( information ) {
|
||||
for ( i=1 ; i <= information->maximum ; i++ ) {
|
||||
the_thread = (Thread_Control *)information->local_table[ i ];
|
||||
|
||||
if ( !the_thread )
|
||||
continue;
|
||||
|
||||
the_thread->ticks_executed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
the_thread->ticks_executed = 0;
|
||||
}
|
||||
|
||||
void CPU_usage_Reset( void )
|
||||
{
|
||||
CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
|
||||
|
||||
rtems_iterate_over_all_threads(CPU_usage_Per_thread_handler);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user