summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-22 16:17:48 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-22 16:17:48 -0500
commit9372906a093ed962e8b924dca65fbf5c77fc6a16 (patch)
tree44faea3a4b6d012ce66d361313285a14ca6e6d6e
parentlookup_task.c: Fix bug where only first four chars of name mattered (diff)
downloadrtems-schedsim-9372906a093ed962e8b924dca65fbf5c77fc6a16.tar.bz2
main_dump_all_cpus.c: Stop at end of args or CPUs
-rw-r--r--schedsim/shell/shared/main_dump_all_cpus.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/schedsim/shell/shared/main_dump_all_cpus.c b/schedsim/shell/shared/main_dump_all_cpus.c
index 1c141e1..5f55298 100644
--- a/schedsim/shell/shared/main_dump_all_cpus.c
+++ b/schedsim/shell/shared/main_dump_all_cpus.c
@@ -59,7 +59,7 @@ int main_dump_all_cpus(int argc, char **argv)
* Now verify the thread on each processor.
*/
mismatch = false;
- for ( cpu=0 ; cpu < rtems_get_processor_count() ; cpu++ ) {
+ for ( cpu=0 ; cpu < rtems_get_processor_count() && cpu < argc ; cpu++ ) {
e = _Per_CPU_Information[cpu].per_cpu.executing;
if ( argv[cpu + 1][ 0 ] == '-' )
@@ -68,14 +68,34 @@ int main_dump_all_cpus(int argc, char **argv)
if ( lookup_task( argv[cpu + 1], &id ) )
return -1;
- if ( e->Object.id != id ) {
- mismatch = true;
- printf(
- "*** ERROR on CPU %d Expected 0x%08x found 0x%08x executing\n",
- cpu,
- id,
- e->Object.id
- );
+ if ( !strcmp( argv[cpu + 1], "IDLE" )) {
+ /* XXX should do something cleaner for the ID mask */
+ if ( (e->Object.id & 0xFFFF0000) != 0x09010000 ) {
+ mismatch = true;
+ printf(
+ "*** ERROR on CPU %d Expected an IDLE found 0x%08x executing\n",
+ cpu,
+ e->Object.id
+ );
+ }
+ } else {
+ if ( lookup_task( argv[cpu + 1], &id ) ) {
+ printf(
+ "*** ERROR in scenario -- unknown task %s\n",
+ argv[cpu + 1]
+ );
+ exit( 1 );
+ }
+
+ if ( e->Object.id != id ) {
+ mismatch = true;
+ printf(
+ "*** ERROR on CPU %d Expected 0x%08x found 0x%08x executing\n",
+ cpu,
+ id,
+ e->Object.id
+ );
+ }
}
}
if ( mismatch ) {