[rtems-schedsim commit] schedsim_smppriority_affinity: New scenarios.
Jennifer Averett
jennifer at rtems.org
Tue Jun 3 12:24:15 UTC 2014
Module: rtems-schedsim
Branch: master
Commit: c8d1dbb21acb07b75c00eac3d2a0caa8a679c5db
Changeset: http://git.rtems.org/rtems-schedsim/commit/?id=c8d1dbb21acb07b75c00eac3d2a0caa8a679c5db
Author: Jennifer Averett <jennifer.averett at oarcorp.com>
Date: Tue Jun 3 07:27:33 2014 -0500
schedsim_smppriority_affinity: New scenarios.
---
.../scenarios/cpus2_affinity_case3.expected | 78 +++++++++++++
.../scenarios/cpus2_affinity_case3.scen | 28 +++++
.../scenarios/cpus4_affinity_api_case3.expected | 107 ++++++++++++++++++
.../scenarios/cpus4_affinity_api_case3.scen | 32 +++++
.../scenarios/cpus4_affinity_api_case4.expected | 119 ++++++++++++++++++++
.../scenarios/cpus4_affinity_api_case4.scen | 27 +++++
.../scenarios/cpus4_affinity_create_case1.scen | 38 ++++++
7 files changed, 429 insertions(+), 0 deletions(-)
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.expected b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.expected
new file mode 100644
index 0000000..fdc5267
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.expected
@@ -0,0 +1,78 @@
+Script File : cpus2_affinity_case3.scen
+verbose : 1
+==> 1: #
+==> 2: # Force Cores such that the first created task
+==> 3: # is on CPU 0 and the second is on CPU 1.
+==> 4: #
+==> 5: rtems_init 2
+ CPU 0: Thread Heir: 0x09010001 priority=255
+ CPU 0: Thread Executing: 0x09010001 priority=255
+ CPU 1: Thread Heir: 0x09010002 priority=255
+ CPU 1: Thread Executing: 0x09010002 priority=255
+==> 6:
+==> 7: cpus IDLE IDLE
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+=== End of Ready Set of Threads
+==> 8:
+==> 9: task_create smp1 4
+Creating task with: Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=4
+Task (smp1) starting: id=0x0a010001, priority=4
+ CPU 1: Thread Heir: 0x0a010001 priority=4
+ CPU 1: Thread Executing: 0x0a010001 priority=4
+==> 10: task_create smp2 4
+Creating task with: Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (smp2) starting: id=0x0a010002, priority=4
+ CPU 0: Thread Heir: 0x0a010002 priority=4
+ CPU 0: Thread Executing: 0x0a010002 priority=4
+==> 11:
+==> 12: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+==> 13: # GOAL: on CPUs 1 -0 respectively
+==> 14: cpus smp2 smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 1: 0x0a010001 @ 4 / 0x0a010001 @ 4 false
+=== End of Ready Set of Threads
+==> 15:
+==> 16: task_set_affinity smp1 0x02
+Task (0x0a010001) Set affinity=0x00000002
+==> 17: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+==> 18: # GOAL: on CPUs 1 -0 respectively
+==> 19: cpus smp2 smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 1: 0x0a010001 @ 4 / 0x0a010001 @ 4 false
+=== End of Ready Set of Threads
+==> 20:
+==> 21: task_set_affinity smp1 0x01
+ CPU 1: Thread Heir: 0x09010001 priority=255
+ CPU 1: Thread Executing: 0x09010001 priority=255
+Task (0x0a010001) Set affinity=0x00000001
+==> 22: # GOAL: want 0x0a010002 on cpu1 and idle on cpu0
+==> 23: cpus smp2 IDLE
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 1: 0x09010001 @255 / 0x09010001 @255 false
+=== End of Ready Set of Threads
+==> 24:
+==> 25: task_set_affinity smp2 0x02
+ CPU 0: Thread Heir: 0x0a010001 priority=4
+ CPU 0: Thread Executing: 0x0a010001 priority=4
+ CPU 1: Thread Heir: 0x0a010002 priority=4
+ CPU 1: Thread Executing: 0x0a010002 priority=4
+Task (0x0a010002) Set affinity=0x00000002
+==> 26: # GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+==> 27: # GOAL: on CPUs 0 -1 respectively
+==> 28: cpus smp1 smp2
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010001 @ 4 / 0x0a010001 @ 4 false
+ CPU 1: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+=== End of Ready Set of Threads
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.scen b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.scen
new file mode 100644
index 0000000..eb2eb85
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus2_affinity_case3.scen
@@ -0,0 +1,28 @@
+#
+# Force Cores such that the first created task
+# is on CPU 0 and the second is on CPU 1.
+#
+rtems_init 2
+
+cpus IDLE IDLE
+
+task_create smp1 4
+task_create smp2 4
+
+# GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+# GOAL: on CPUs 1 -0 respectively
+cpus smp2 smp1
+
+task_set_affinity smp1 0x02
+# GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+# GOAL: on CPUs 1 -0 respectively
+cpus smp2 smp1
+
+task_set_affinity smp1 0x01
+# GOAL: want 0x0a010002 on cpu1 and idle on cpu0
+cpus smp2 IDLE
+
+task_set_affinity smp2 0x02
+# GOAL: want 0x0a010001 - 0x0a010002 as heir and executings
+# GOAL: on CPUs 0 -1 respectively
+cpus smp1 smp2
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.expected b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.expected
new file mode 100644
index 0000000..a143fba
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.expected
@@ -0,0 +1,107 @@
+Script File : cpus4_affinity_api_case3.scen
+verbose : 1
+==> 1: #
+==> 2: # Verify that affinity APIs work with the right values
+==> 3: #
+==> 4: # This scenario does **NOT** change the affinity of any thread
+==> 5: # which ever executes.
+==> 6: #
+==> 7: rtems_init 4
+ CPU 0: Thread Heir: 0x09010001 priority=255
+ CPU 0: Thread Executing: 0x09010001 priority=255
+ CPU 1: Thread Heir: 0x09010002 priority=255
+ CPU 1: Thread Executing: 0x09010002 priority=255
+ CPU 2: Thread Heir: 0x09010003 priority=255
+ CPU 2: Thread Executing: 0x09010003 priority=255
+ CPU 3: Thread Heir: 0x09010004 priority=255
+ CPU 3: Thread Executing: 0x09010004 priority=255
+==> 8: task_create smp1 5
+Creating task with: Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=5
+Task (smp1) starting: id=0x0a010001, priority=5
+ CPU 3: Thread Heir: 0x0a010001 priority=5
+ CPU 3: Thread Executing: 0x0a010001 priority=5
+==> 9: current_cpu 3
+Changing current CPU from 0 to 3
+==> 10:
+==> 11: dispatch
+==> 12: cpus IDLE IDLE IDLE smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 13:
+==> 14: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x0000000f
+==> 15: task_set_affinity smp1 0x08
+Task (0x0a010001) Set affinity=0x00000008
+==> 16: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x00000008
+==> 17: cpus IDLE IDLE IDLE smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 18:
+==> 19: task_set_affinity smp1 0x04
+ CPU 2: Thread Heir: 0x0a010001 priority=5
+ CPU 2: Thread Executing: 0x0a010001 priority=5
+ CPU 3: Thread Heir: 0x09010004 priority=255
+ CPU 3: Thread Executing: 0x09010004 priority=255
+Task (0x0a010001) Set affinity=0x00000004
+==> 20: current_cpu 2
+Changing current CPU from 3 to 2
+==> 21: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x00000004
+==> 22: cpus IDLE IDLE smp1 IDLE
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+ CPU 3: 0x09010004 @255 / 0x09010004 @255 false
+=== End of Ready Set of Threads
+==> 23:
+==> 24: task_set_affinity smp1 0x02
+ CPU 1: Thread Heir: 0x0a010001 priority=5
+ CPU 1: Thread Executing: 0x0a010001 priority=5
+ CPU 2: Thread Heir: 0x09010003 priority=255
+ CPU 2: Thread Executing: 0x09010003 priority=255
+Task (0x0a010001) Set affinity=0x00000002
+==> 25: current_cpu 1
+Changing current CPU from 2 to 1
+==> 26: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x00000002
+==> 27: cpus IDLE smp1 IDLE IDLE
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x09010004 @255 / 0x09010004 @255 false
+=== End of Ready Set of Threads
+==> 28:
+==> 29: task_set_affinity smp1 0x01
+ CPU 0: Thread Heir: 0x0a010001 priority=5
+ CPU 0: Thread Executing: 0x0a010001 priority=5
+ CPU 1: Thread Heir: 0x09010002 priority=255
+ CPU 1: Thread Executing: 0x09010002 priority=255
+Task (0x0a010001) Set affinity=0x00000001
+==> 30: current_cpu 0
+Changing current CPU from 1 to 0
+==> 31: task_get_affinity smp1
+Task (0x0a010001) Get affinity=0x00000001
+==> 32: cpus smp1 IDLE IDLE IDLE
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x09010004 @255 / 0x09010004 @255 false
+=== End of Ready Set of Threads
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.scen b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.scen
new file mode 100644
index 0000000..04609b7
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case3.scen
@@ -0,0 +1,32 @@
+#
+# Verify that affinity APIs work with the right values
+#
+# This scenario does **NOT** change the affinity of any thread
+# which ever executes.
+#
+rtems_init 4
+task_create smp1 5
+current_cpu 3
+
+dispatch
+cpus IDLE IDLE IDLE smp1
+
+task_get_affinity smp1
+task_set_affinity smp1 0x08
+task_get_affinity smp1
+cpus IDLE IDLE IDLE smp1
+
+task_set_affinity smp1 0x04
+current_cpu 2
+task_get_affinity smp1
+cpus IDLE IDLE smp1 IDLE
+
+task_set_affinity smp1 0x02
+current_cpu 1
+task_get_affinity smp1
+cpus IDLE smp1 IDLE IDLE
+
+task_set_affinity smp1 0x01
+current_cpu 0
+task_get_affinity smp1
+cpus smp1 IDLE IDLE IDLE
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.expected b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.expected
new file mode 100644
index 0000000..5d7bfbd
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.expected
@@ -0,0 +1,119 @@
+Script File : cpus4_affinity_api_case4.scen
+verbose : 1
+==> 1: #
+==> 2: # Verify that affinity APIs work with the right values
+==> 3: #
+==> 4: # This scenario does **NOT** change the affinity of any thread
+==> 5: # which ever executes.
+==> 6: #
+==> 7: rtems_init 4
+ CPU 0: Thread Heir: 0x09010001 priority=255
+ CPU 0: Thread Executing: 0x09010001 priority=255
+ CPU 1: Thread Heir: 0x09010002 priority=255
+ CPU 1: Thread Executing: 0x09010002 priority=255
+ CPU 2: Thread Heir: 0x09010003 priority=255
+ CPU 2: Thread Executing: 0x09010003 priority=255
+ CPU 3: Thread Heir: 0x09010004 priority=255
+ CPU 3: Thread Executing: 0x09010004 priority=255
+==> 8: task_create smp1 5
+Creating task with: Preemption: yes Timeslicing: no
+Task (smp1) created: id=0x0a010001, priority=5
+Task (smp1) starting: id=0x0a010001, priority=5
+Send Interrupt to cpu 3
+ CPU 3: Thread Heir: 0x0a010001 priority=5
+ CPU 3: Thread Executing: 0x0a010001 priority=5
+==> 9: current_cpu 3
+Changing current CPU from 0 to 3
+==> 10:
+==> 11: dispatch
+==> 12: cpus IDLE IDLE IDLE smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 13:
+==> 14: task_create smp2 4
+Creating task with: Preemption: yes Timeslicing: no
+Task (smp2) created: id=0x0a010002, priority=4
+Task (smp2) starting: id=0x0a010002, priority=4
+Send Interrupt to cpu 2
+ CPU 2: Thread Heir: 0x0a010002 priority=4
+ CPU 2: Thread Executing: 0x0a010002 priority=4
+==> 15: cpus IDLE IDLE smp2 smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 16:
+==> 17: task_set_affinity smp2 0x01
+Send Interrupt to cpu 2
+Send Interrupt to cpu 0
+ CPU 0: Thread Heir: 0x0a010002 priority=4
+ CPU 0: Thread Executing: 0x0a010002 priority=4
+ CPU 2: Thread Heir: 0x09010003 priority=255
+ CPU 2: Thread Executing: 0x09010003 priority=255
+Task (0x0a010002) Set affinity=0x00000001
+==> 18: cpus smp2 IDLE IDLE smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 19:
+==> 20: task_set_affinity smp2 0x02
+Send Interrupt to cpu 0
+Send Interrupt to cpu 1
+ CPU 0: Thread Heir: 0x09010001 priority=255
+ CPU 0: Thread Executing: 0x09010001 priority=255
+ CPU 1: Thread Heir: 0x0a010002 priority=4
+ CPU 1: Thread Executing: 0x0a010002 priority=4
+Task (0x0a010002) Set affinity=0x00000002
+==> 21: cpus IDLE smp2 IDLE smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 2: 0x09010003 @255 / 0x09010003 @255 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 22:
+==> 23: task_set_affinity smp2 0x04
+Send Interrupt to cpu 1
+Send Interrupt to cpu 2
+ CPU 1: Thread Heir: 0x09010002 priority=255
+ CPU 1: Thread Executing: 0x09010002 priority=255
+ CPU 2: Thread Heir: 0x0a010002 priority=4
+ CPU 2: Thread Executing: 0x0a010002 priority=4
+Task (0x0a010002) Set affinity=0x00000004
+==> 24: cpus IDLE IDLE smp2 smp1
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+ CPU 3: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+=== End of Ready Set of Threads
+==> 25:
+==> 26: task_set_affinity smp2 0x08
+Send Interrupt to cpu 2
+ CPU 2: Thread Heir: 0x0a010001 priority=5
+ CPU 2: Thread Executing: 0x0a010001 priority=5
+ CPU 3: Thread Heir: 0x0a010002 priority=4
+ CPU 3: Thread Executing: 0x0a010002 priority=4
+Task (0x0a010002) Set affinity=0x00000008
+==> 27: cpus IDLE IDLE smp1 smp2
+=== CPU Status
+ EXECUTING / HEIR / SWITCH NEEDED
+ CPU 0: 0x09010001 @255 / 0x09010001 @255 false
+ CPU 1: 0x09010002 @255 / 0x09010002 @255 false
+ CPU 2: 0x0a010001 @ 5 / 0x0a010001 @ 5 false
+ CPU 3: 0x0a010002 @ 4 / 0x0a010002 @ 4 false
+=== End of Ready Set of Threads
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.scen b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.scen
new file mode 100644
index 0000000..bfcab32
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_api_case4.scen
@@ -0,0 +1,27 @@
+#
+# Verify that affinity APIs work with the right values
+#
+# This scenario does **NOT** change the affinity of any thread
+# which ever executes.
+#
+rtems_init 4
+task_create smp1 5
+current_cpu 3
+
+dispatch
+cpus IDLE IDLE IDLE smp1
+
+task_create smp2 4
+cpus IDLE IDLE smp2 smp1
+
+task_set_affinity smp2 0x01
+cpus smp2 IDLE IDLE smp1
+
+task_set_affinity smp2 0x02
+cpus IDLE smp2 IDLE smp1
+
+task_set_affinity smp2 0x04
+cpus IDLE IDLE smp2 smp1
+
+task_set_affinity smp2 0x08
+cpus IDLE IDLE smp1 smp2
diff --git a/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_create_case1.scen b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_create_case1.scen
new file mode 100644
index 0000000..6204db8
--- /dev/null
+++ b/schedsim/shell/schedsim_smppriority_affinity/scenarios/cpus4_affinity_create_case1.scen
@@ -0,0 +1,38 @@
+#
+# Create threads of single cpu affinity to fill the
+# cpus. Have a single of the same priority on the
+# ready chain that can run on any cpu. Change the
+# affinity of one of the running threads forcing it
+# to move to the ready chain and quit running.
+#
+rtems_init 4
+task_create smp1 8
+current_cpu 3
+
+cpus IDLE IDLE IDLE smp1
+
+task_create smp2 4 -a 0x4
+cpus IDLE IDLE smp2 smp1
+
+task_create smp3 4 -a 0x1
+cpus smp3 IDLE smp2 smp1
+
+task_delete smp2
+cpus smp3 IDLE smp1 IDLE
+
+task_create smp4 4 -a 0x8
+current_cpu 2
+cpus smp3 IDLE smp1 smp4
+
+task_delete smp3
+cpus smp1 IDLE IDLE smp4
+
+task_create smp5 4 -a 0x2
+cpus smp1 smp5 IDLE smp4
+
+task_delete smp4
+cpus smp1 smp5 IDLE IDLE
+
+task_delete smp5
+cpus smp1 IDLE IDLE IDLE
+
More information about the vc
mailing list