[PATCH 2/2] capture01: Add multiple calls of the test so that several create/delete of tasks is called.
Jennifer Averett
jennifer.averett at oarcorp.com
Tue Aug 26 20:16:12 UTC 2014
---
testsuites/libtests/capture01/init.c | 33 ++++++++++++++++++++++++---------
testsuites/libtests/capture01/system.h | 2 +-
testsuites/libtests/capture01/test1.c | 10 +++++-----
3 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/testsuites/libtests/capture01/init.c b/testsuites/libtests/capture01/init.c
index fc06597..fa92cb8 100644
--- a/testsuites/libtests/capture01/init.c
+++ b/testsuites/libtests/capture01/init.c
@@ -113,7 +113,7 @@ static void cwlist ()
}
}
-static void ctrace()
+void ctrace()
{
rtems_status_code sc;
bool csv = false;
@@ -159,7 +159,6 @@ static void ctrace()
(rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
(rec->events >> RTEMS_CAPTURE_EVENT_START),
(uint64_t) rec->time);
- else
{
uint32_t event;
int e;
@@ -170,12 +169,10 @@ static void ctrace()
{
if (event & 1)
{
+ char name[5];
+ rtems_capture_name_to_string( rec->task->name, 5, name );
rtems_monitor_dump_id (rtems_capture_task_id (rec->task));
- fprintf (stdout, " %c%c%c%c",
- (char) (rec->task->name >> 24) & 0xff,
- (char) (rec->task->name >> 16) & 0xff,
- (char) (rec->task->name >> 8) & 0xff,
- (char) (rec->task->name >> 0) & 0xff);
+ fprintf (stdout, " %5s", name );
fprintf (stdout, " %3" PRId32 " %3" PRId32 " %s\n",
(rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
(rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
@@ -215,7 +212,7 @@ rtems_task Init(
rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
- sc = rtems_capture_open (5000, NULL);
+ sc = rtems_capture_open (5000, 20, NULL);
ASSERT_SC(sc);
sc = rtems_capture_watch_ceiling (100);
@@ -242,10 +239,28 @@ rtems_task Init(
sc = rtems_capture_control (true);
ASSERT_SC(sc);
- capture_test_1();
+ capture_test_1(0);
+
+ ctrace();
+ ctrace();
+
+ capture_test_1(1);
+ ctrace();
+
+ capture_test_1(3);
+
+ ctrace();
+ ctrace();
+
+ capture_test_1(4);
+ capture_test_1(5);
+ capture_test_1(6);
ctrace();
ctrace();
+ ctrace();
+ ctrace();
+ ctrace();
rtems_test_end();
exit( 0 );
diff --git a/testsuites/libtests/capture01/system.h b/testsuites/libtests/capture01/system.h
index 62c221f..e586b30 100644
--- a/testsuites/libtests/capture01/system.h
+++ b/testsuites/libtests/capture01/system.h
@@ -20,7 +20,7 @@ rtems_task Init(
rtems_task_argument argument
);
-void capture_test_1(void);
+void capture_test_1(int start);
/* configuration information */
diff --git a/testsuites/libtests/capture01/test1.c b/testsuites/libtests/capture01/test1.c
index 5e334fc..63de241 100644
--- a/testsuites/libtests/capture01/test1.c
+++ b/testsuites/libtests/capture01/test1.c
@@ -109,7 +109,7 @@ capture_CT1c (rtems_task_argument arg)
rtems_task_delete (RTEMS_SELF);
}
-void capture_test_1 ()
+void capture_test_1 (int start)
{
rtems_status_code sc;
rtems_name name;
@@ -121,7 +121,7 @@ void capture_test_1 ()
capture_CT1b_deleted = 0;
capture_CT1c_deleted = 0;
- name = rtems_build_name('C', 'T', 'm', '1');
+ name = rtems_build_name('C', 'T', 'm', '1'+start);
sc = rtems_semaphore_create (name, 1,
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
@@ -135,7 +135,7 @@ void capture_test_1 ()
return;
}
- name = rtems_build_name('C', 'T', '1', 'a');
+ name = rtems_build_name('C', 'T', '1'+start, 'a');
sc = rtems_task_create (name, 102, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
@@ -163,7 +163,7 @@ void capture_test_1 ()
capture_wait (1000);
- name = rtems_build_name('C', 'T', '1', 'b');
+ name = rtems_build_name('C', 'T', '1'+start, 'b');
sc = rtems_task_create (name, 101, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
@@ -193,7 +193,7 @@ void capture_test_1 ()
capture_wait (1000);
- name = rtems_build_name('C', 'T', '1', 'c');
+ name = rtems_build_name('C', 'T', '1'+start, 'c');
sc = rtems_task_create (name, 100, 2 * 1024,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
--
1.8.1.4
More information about the devel
mailing list