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

* 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.
This commit is contained in:
Joel Sherrill
2007-05-17 22:46:45 +00:00
parent e57739da09
commit c3330a88ee
19 changed files with 696 additions and 191 deletions

View File

@@ -215,7 +215,8 @@ void Stack_check_report_blown_task(
Stack_Control *stack = &running->Start.Initial_stack;
printk(
"BLOWN STACK!!! Offending task(%p): id=0x%08" PRIx32 "; name=0x%08" PRIx32,
"BLOWN STACK!!! Offending task(0x%p): "
"id=0x%08" PRIx32 "; name=0x%08" PRIx32,
running,
running->Object.id,
(uint32_t) running->Object.name
@@ -233,7 +234,7 @@ void Stack_check_report_blown_task(
#endif
printk(
" stack covers range %p - %p (%d bytes)\n",
" stack covers range 0x%p - 0x%p (%d bytes)\n",
stack->area,
stack->area + stack->size - 1,
stack->size
@@ -325,8 +326,8 @@ void *Stack_check_find_high_water_mark(
base += length - 1;
for (ebase = s; base > ebase; base--)
if (*base != U32_PATTERN)
return (void *) base;
if (*base != U32_PATTERN)
return (void *) base;
#else
/*
* start at lower memory and find first word that does not
@@ -335,38 +336,13 @@ void *Stack_check_find_high_water_mark(
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
return (void *) base;
if (*base != U32_PATTERN)
return (void *) base;
#endif
return (void *)0;
}
/*
* Report Name
*/
char *Stack_check_Get_object_name(
Objects_Control *the_object,
char **name
)
{
Objects_Information *info;
info = _Objects_Get_information(the_object->id);
if ( info->is_string ) {
*name = (char *) the_object->name;
} else {
uint32_t u32_name = (uint32_t) the_object->name;
(*name)[ 0 ] = (u32_name >> 24) & 0xff;
(*name)[ 1 ] = (u32_name >> 16) & 0xff;
(*name)[ 2 ] = (u32_name >> 8) & 0xff;
(*name)[ 3 ] = (u32_name >> 0) & 0xff;
(*name)[ 4 ] = '\0';
}
return *name;
}
/*
* Stack_check_Dump_threads_usage(
*
@@ -380,9 +356,7 @@ void Stack_check_Dump_threads_usage(
void *low;
void *high_water_mark;
Stack_Control *stack;
uint32_t u32_name;
char name_str[5];
char *name;
char name[5];
if ( !the_thread )
return;
@@ -411,19 +385,17 @@ void Stack_check_Dump_threads_usage(
else
used = 0;
name = name_str;
if ( the_thread ) {
name = Stack_check_Get_object_name( &the_thread->Object, &name );
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
} else {
u32_name = rtems_build_name('I', 'N', 'T', 'R');
name[ 0 ] = (u32_name >> 24) & 0xff;
name[ 1 ] = (u32_name >> 16) & 0xff;
name[ 2 ] = (u32_name >> 8) & 0xff;
name[ 3 ] = (u32_name >> 0) & 0xff;
name[ 0 ] = 'I';
name[ 1 ] = 'N';
name[ 2 ] = 'T';
name[ 3 ] = 'R';
name[ 4 ] = '\0';
}
printk("0x%08" PRIx32 " %4s %p - %p %8" PRId32 " %8" PRId32 "\n",
printk("0x%08" PRIx32 " %4s 0x%p - 0x%p %8" PRId32 " %8" PRId32 "\n",
the_thread ? the_thread->Object.id : ~0,
name,
stack->area,