[PATCH 1/4] capture: Move logging of task record to occur after filter check.

2014-11-04 Thread Jennifer Averett
The catpture task record is now logged just prior to the first
log entry using that task instead of the first time the task
is seen.  This involved splitting the record task method into
an initialize task and a record task.
---
 cpukit/libmisc/capture/capture.c| 39 +--
 cpukit/libmisc/capture/capture.h| 24 +++-
 cpukit/libmisc/capture/capture_user_extension.c | 51 +
 3 files changed, 78 insertions(+), 36 deletions(-)

diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 28fa1dd..a83bc90 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -313,26 +313,35 @@ rtems_capture_create_control (rtems_name name, rtems_id 
id)
   return control;
 }
 
-void rtems_capture_record_task( rtems_tcb* tcb )
+void rtems_capture_initialize_task( rtems_tcb* tcb )
 {
   rtems_capture_control_t*control;
-  rtems_capture_task_record_t rec;
-  void*   ptr;
-
-  rtems_object_get_classic_name( tcb->Object.id, &rec.name );
+  rtems_name  name;
 
   /*
* We need to scan the default control list to initialise
* this control if it is a new task.
*/
 
+  rtems_object_get_classic_name( tcb->Object.id, &name );
+
   if (tcb->Capture.control == NULL) {
 for (control = capture_controls; control != NULL; control = control->next)
   if (rtems_capture_match_name_id (control->name, control->id,
-   rec.name, tcb->Object.id))
+   name, tcb->Object.id))
 tcb->Capture.control = control;
   }
 
+  tcb->Capture.flags |= RTEMS_CAPTURE_INIT_TASK;
+}
+
+void rtems_capture_record_task( rtems_tcb* tcb )
+{
+  rtems_capture_task_record_t rec;
+  void*   ptr;
+
+  rtems_object_get_classic_name( tcb->Object.id, &rec.name );
+   
   rec.stack_size = tcb->Start.Initial_stack.size;
   rec.start_priority = _RTEMS_tasks_Priority_from_Core(
 tcb->Start.initial_priority
@@ -1224,6 +1233,8 @@ rtems_capture_release (uint32_t count)
   rtems_capture_record_t*  rec;
   uint32_t counted;
   size_t   ptr_size = 0;
+  size_t   rel_size = 0;
+  rtems_status_coderet_val = RTEMS_SUCCESSFUL;
 
   rtems_interrupt_lock_acquire (&capture_lock, &lock_context);
 
@@ -1237,26 +1248,32 @@ rtems_capture_release (uint32_t count)
   ptr = rtems_capture_buffer_peek( &capture_records, &ptr_size );
   _Assert(ptr_size >= (count * sizeof(*rec) ));
 
-  ptr_size = 0;
+  rel_size = 0;
   while (counted--)
-  { 
+  {
 rec = (rtems_capture_record_t*) ptr;
-ptr_size += rec->size;
+rel_size += rec->size;
+_Assert( rel_size <= ptr_size );
 ptr += rec->size;
   }
 
   rtems_interrupt_lock_acquire (&capture_lock, &lock_context);
 
+  if (rel_size > ptr_size ) {
+ret_val = RTEMS_INVALID_NUMBER;
+rel_size = ptr_size;
+  }
+
   capture_count -= count;
 
   if (count) 
-rtems_capture_buffer_free( &capture_records, ptr_size );
+rtems_capture_buffer_free( &capture_records, rel_size );
 
   capture_flags &= ~RTEMS_CAPTURE_READER_ACTIVE;
 
   rtems_interrupt_lock_release (&capture_lock, &lock_context);
 
-  return RTEMS_SUCCESSFUL;
+  return ret_val;
 }
 
 /*
diff --git a/cpukit/libmisc/capture/capture.h b/cpukit/libmisc/capture/capture.h
index a4c3310..f907686 100644
--- a/cpukit/libmisc/capture/capture.h
+++ b/cpukit/libmisc/capture/capture.h
@@ -141,7 +141,8 @@ typedef struct rtems_capture_control_s
  * Task flags.
  */
 #define RTEMS_CAPTURE_TRACED  (1U << 0)
-#define RTEMS_CAPTURE_RECORD_TASK (1U << 1)
+#define RTEMS_CAPTURE_INIT_TASK   (1U << 1)
+#define RTEMS_CAPTURE_RECORD_TASK (1U << 2)
 
 /*
  * @brief Capture record.
@@ -598,6 +599,15 @@ const char*
 rtems_capture_event_text (int event);
 
 /**
+ * @brief Capture initialize task
+ *
+ * This function initializes capture control in the tcb.
+ *
+ * @param[in] tcb is the task control block for the task
+ */
+void rtems_capture_initialize_task( rtems_tcb* tcb );
+
+/**
  * @brief Capture record task.
  * 
  * This function records a new capture task record.
@@ -619,6 +629,18 @@ static inline bool rtems_capture_task_recorded( rtems_tcb* 
tcb ) {
 }
 
 /**
+ * @brief Capture task initialized
+ *
+ * This function returns true if this task information has been 
+ * initialized.
+ *
+ * @param[in] tcb is the task control block for the task
+ */
+static inline bool rtems_capture_task_initialized( rtems_tcb* tcb ) {
+  return ( (tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0 );
+}
+
+/**
  * @brief Capture get task id.
  * 
  * This function returns the task id.
diff --git a/cpukit/libmisc/capture/capture_user_extension.c 
b/cpukit/libmisc/capture/capture_user_extension.c
index 4c7bc1d..69b8d48 100644
--- a/cpukit/libmisc/capture/capture_user_extension.c
+++ b/cpukit/libmisc/capture/capture_user_extension.c
@@ -95,6 +95,9 @@ stat

[PATCH 2/4] capture: Add SMP support.

2014-11-04 Thread Jennifer Averett
To support smp data was broken into global and percpu capture data.
Capture control must be disabled prior to printing or setting of
watch points.

Methods to print the data were moved from capture-cli into
a support area and are no longer static so that they can
be shared by test routines, or application code that wants
to use the capture engine without the shell interface.
---
 cpukit/libmisc/Makefile.am  |   1 +
 cpukit/libmisc/capture/capture-cli.c| 221 +
 cpukit/libmisc/capture/capture-cli.h|   4 +-
 cpukit/libmisc/capture/capture.c| 411 +---
 cpukit/libmisc/capture/capture.h|  82 ++---
 cpukit/libmisc/capture/capture_buffer.c |   6 +-
 cpukit/libmisc/capture/capture_buffer.h |   6 +-
 cpukit/libmisc/capture/capture_support.c| 307 ++
 cpukit/libmisc/capture/capture_user_extension.c |  17 +-
 cpukit/libmisc/capture/captureimpl.h| 102 --
 10 files changed, 667 insertions(+), 490 deletions(-)
 create mode 100644 cpukit/libmisc/capture/capture_support.c

diff --git a/cpukit/libmisc/Makefile.am b/cpukit/libmisc/Makefile.am
index 021a251..352379d 100644
--- a/cpukit/libmisc/Makefile.am
+++ b/cpukit/libmisc/Makefile.am
@@ -19,6 +19,7 @@ EXTRA_DIST += capture/README
 noinst_LIBRARIES += libcapture.a
 libcapture_a_SOURCES = capture/capture.c capture/capture-cli.c \
 capture/capture_user_extension.c capture/capture_buffer.c \
+capture/capture_support.c \
 capture/capture.h capture/captureimpl.h capture/capture-cli.h \
 capture/capture_buffer.h
 
diff --git a/cpukit/libmisc/capture/capture-cli.c 
b/cpukit/libmisc/capture/capture-cli.c
index ad53ccc..595c9cf 100644
--- a/cpukit/libmisc/capture/capture-cli.c
+++ b/cpukit/libmisc/capture/capture-cli.c
@@ -5,7 +5,7 @@
   All rights reserved Objective Design Systems Pty Ltd, 2002
   Chris Johns (c...@acm.org)
 
-  COPYRIGHT (c) 1989-1998.
+  COPYRIGHT (c) 1989-2014.
   On-Line Applications Research Corporation (OAR).
 
   The license and distribution terms for this file may be
@@ -41,6 +41,13 @@
 
 #define RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS (20)
 
+typedef struct {
+  rtems_capture_record_t* rec;
+  uint32_tread;
+  uint32_tlast_t;
+  uint32_tprinted;
+} ctrace_per_cpu_t;
+
 /*
  * Counter used to count the number of active tasks.
  */
@@ -209,31 +216,6 @@ rtems_capture_cli_disable (int 
   argc RC_UNUSED,
   fprintf (stdout, "capture engine disabled.\n");
 }
 
-/*
- * rtems_catpure_cli_print_uptime
- *
- *  DESCRIPTION:
- *
- * This function prints the nanosecond uptime to stdout.
- */
-static void
-rtems_capture_cli_print_timestamp (uint64_t uptime)
-{
-  uint32_t hours;
-  uint32_t minutes;
-  uint32_t seconds;
-  uint32_t nanosecs;
-
-  seconds  = uptime / 10LLU;
-  minutes  = seconds / 60;
-  hours= minutes / 60;
-  minutes  = minutes % 60;
-  seconds  = seconds % 60;
-  nanosecs = uptime % 10;
-
-  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds, 
nanosecs);
-}
-
 static void
 rtems_capture_cli_print_task (rtems_tcb *tcb)
 {
@@ -273,47 +255,6 @@ rtems_capture_cli_print_task (rtems_tcb *tcb)
   }
   fprintf (stdout, "\n");
 }
-static void
-rtems_caputure_cli_print_record_std(rtems_capture_record_t* rec, uint64_t diff)
-{
-  uint32_t event;
-  int  e;
-
-  event = rec->events >> RTEMS_CAPTURE_EVENT_START;
-
-  for (e = RTEMS_CAPTURE_EVENT_START; e < RTEMS_CAPTURE_EVENT_END; e++)
-  {
-if (event & 1)
-{
-  rtems_capture_cli_print_timestamp (rec->time);
-  fprintf (stdout, " %9" PRId64 " ", diff);
-  rtems_monitor_dump_id (rec->task_id);
-  fprintf(stdout, "  %3" PRId32 " %3" PRId32 " %s\n",
- (rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
- (rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
- rtems_capture_event_text (e));
-}
-event >>= 1;
-  }
-}
-
-static void
-rtems_caputre_cli_print_record_task(rtems_capture_record_t* rec)
-{
-  rtems_capture_task_record_t* task_rec = (rtems_capture_task_record_t*) rec;
-
-  rtems_capture_cli_print_timestamp (rec->time);
-  fprintf (stdout, "   ");
-  rtems_monitor_dump_id (rec->task_id);
-   fprintf (stdout, " %c%c%c%c",
-(char) (task_rec->name >> 24) & 0xff,
-(char) (task_rec->name >> 16) & 0xff,
-(char) (task_rec->name >> 8) & 0xff,
-(char) (task_rec->name >> 0) & 0xff);
-   fprintf (stdout, " %3" PRId32   " %3" PRId32 "\n",
-task_rec->start_priority,
-task_rec->stack_size);
-}
 
 /*
  * rtems_capture_cli_count_tasks
@@ -355,7 +296,7 @@ rtems_capture_cli_task_list (int
argc RC_UNUSED,
   rtems_iterate_over_all_threads (rtems_capture_cli_count_tasks);
 
   fprintf (stdout, "uptime: ");
-  rtems

[PATCH 4/4] smpcapture01: New test.

2014-11-04 Thread Jennifer Averett
---
 testsuites/smptests/Makefile.am   |   1 +
 testsuites/smptests/configure.ac  |   1 +
 testsuites/smptests/smpcapture01/Makefile.am  |  19 ++
 testsuites/smptests/smpcapture01/init.c   | 273 ++
 testsuites/smptests/smpcapture01/smpcapture01.doc |  28 +++
 testsuites/smptests/smpcapture01/smpcapture01.scn |  45 
 6 files changed, 367 insertions(+)
 create mode 100644 testsuites/smptests/smpcapture01/Makefile.am
 create mode 100644 testsuites/smptests/smpcapture01/init.c
 create mode 100644 testsuites/smptests/smpcapture01/smpcapture01.doc
 create mode 100644 testsuites/smptests/smpcapture01/smpcapture01.scn

diff --git a/testsuites/smptests/Makefile.am b/testsuites/smptests/Makefile.am
index 1e72d43..87c3d7f 100644
--- a/testsuites/smptests/Makefile.am
+++ b/testsuites/smptests/Makefile.am
@@ -12,6 +12,7 @@ SUBDIRS += smp09
 SUBDIRS += smpaffinity01
 SUBDIRS += smpatomic01
 SUBDIRS += smpcache01
+SUBDIRS += smpcapture01
 SUBDIRS += smpfatal01
 SUBDIRS += smpfatal02
 SUBDIRS += smpfatal03
diff --git a/testsuites/smptests/configure.ac b/testsuites/smptests/configure.ac
index 9b6d99b..e7b96ae 100644
--- a/testsuites/smptests/configure.ac
+++ b/testsuites/smptests/configure.ac
@@ -67,6 +67,7 @@ smp09/Makefile
 smpaffinity01/Makefile
 smpatomic01/Makefile
 smpcache01/Makefile
+smpcapture01/Makefile
 smpfatal01/Makefile
 smpfatal02/Makefile
 smpfatal03/Makefile
diff --git a/testsuites/smptests/smpcapture01/Makefile.am 
b/testsuites/smptests/smpcapture01/Makefile.am
new file mode 100644
index 000..084f404
--- /dev/null
+++ b/testsuites/smptests/smpcapture01/Makefile.am
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = smpcapture01
+smpcapture01_SOURCES = init.c
+
+dist_rtems_tests_DATA = smpcapture01.scn smpcapture01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(smpcapture01_OBJECTS)
+LINK_LIBS = $(smpcapture01_LDLIBS)
+
+smpcapture01$(EXEEXT): $(smpcapture01_OBJECTS) $(smpcapture01_DEPENDENCIES)
+   @rm -f smpcapture01$(EXEEXT)
+   $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/smptests/smpcapture01/init.c 
b/testsuites/smptests/smpcapture01/init.c
new file mode 100644
index 000..f635efa
--- /dev/null
+++ b/testsuites/smptests/smpcapture01/init.c
@@ -0,0 +1,273 @@
+/*
+ *  COPYRIGHT (c) 2014.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+/*
+ * The init task UT1 should start on cpu 3 and has priority:affinity set
+ * 7:{2,3} The test creates 4 more tasks TA1 - TA4
+ * with priorty:affinity sets 8:{2,3}, 5:{0,1}, 6:{0,3}, and 9:{1}.
+ * This should result in cpu:task  0:TA3, 1:TA2, 2:TA1, 3:UT1 with
+ * TA4 waiting on a cpu.
+ *
+ * The test then raises the priority of TA4 to 4, resulting
+ * in the following cpu:task 0:TA2, 1:TA4, 2:UT1, 3:TA3 with
+ * TA1 waiting on a CPU.  The tasks are then terminated.
+ *
+ * The capture engine is set up read and report the results.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include 
+#include 
+
+#include "tmacros.h"
+
+const char rtems_test_name[] = "SMPCAPTURE 1";
+
+#define NUM_CPUS   4
+#define TASK_COUNT 5
+
+struct task_data_t {
+  rtems_idid;
+  cpu_set_t   cpuset;
+  rtems_task_priority priority;
+  boolran;
+  int expected_cpu;
+  int actual_cpu;
+  int migrate_cpu;
+};
+
+static struct task_data_t task_data[TASK_COUNT] = {
+  {0x0, {{0xc}}, 7, false,  3, -1,  2},
+  {0x0, {{0xf}}, 8, false,  2, -1, -1},
+  {0x0, {{0x3}}, 5, false,  1, -1,  0},
+  {0x0, {{0x9}}, 6, false,  0, -1,  3},
+  {0x0, {{0x2}}, 9, false, -1, -1,  1}
+};
+
+rtems_id   task_sem;
+
+/*
+ * Spin loop to allow tasks to delay without yeilding the
+ * processor.
+ */
+static void test_delay(int ticks)
+{
+  rtems_interval start, stop;
+  start = rtems_clock_get_ticks_since_boot();
+  do {
+stop = rtems_clock_get_ticks_since_boot();
+  } while ( (stop - start) < ticks );
+}
+
+static void task(rtems_task_argument arg)
+{
+  rtems_status_code   sc;
+
+  while (true) {
+sc = rtems_semaphore_obtain (task_sem, RTEMS_NO_WAIT, 0);
+if (sc == RTEMS_SUCCESSFUL) {
+  task_data[arg].ran = true;
+  task_data[arg].actual_cpu = rtems_get_current_processor();
+  rtems_semaphore_release(task_sem);
+}
+  }
+}
+
+static void set_init_task(void)
+{
+  while( rtems_semaphore_obtain (task_sem, RTEMS_NO_WAIT, 0) != 
RTEMS_SUCCESSFUL );
+
+  /* Set Init task data */
+  task_data[0].ran = true;
+  task_data[0].actual_cpu = rtems_get_current_processor();
+
+  rtems_semaphore_release(task_sem);
+}
+
+static void test(void)
+{
+ 

[PATCH 3/4] capture01: Add SMP support into capture engine.

2014-11-04 Thread Jennifer Averett
---
 testsuites/libtests/capture01/init.c | 249 ++-
 1 file changed, 12 insertions(+), 237 deletions(-)

diff --git a/testsuites/libtests/capture01/init.c 
b/testsuites/libtests/capture01/init.c
index a725e26..e1e1e84 100644
--- a/testsuites/libtests/capture01/init.c
+++ b/testsuites/libtests/capture01/init.c
@@ -33,229 +33,6 @@ rtems_task Init(rtems_task_argument argument);
 
 const char rtems_test_name[] = "CAPTURE 1";
 
-static void cwlist(void);
-static void ctrace(void);
-
-static void cwlist ()
-{
-  rtems_capture_control_t* control = rtems_capture_get_control_list ();
-  rtems_task_priority  ceiling = rtems_capture_watch_get_ceiling ();
-  rtems_task_priority  floor = rtems_capture_watch_get_floor ();
-
-  fprintf (stdout, "watch priority ceiling is %" PRId32 "\n", ceiling);
-  fprintf (stdout, "watch priority floor is %" PRId32 "\n", floor);
-  fprintf (stdout, "global watch is %s\n",
-  rtems_capture_watch_global_on () ? "enabled" : "disabled");
-  fprintf (stdout, "total %" PRId32 "\n", rtems_capture_control_count ());
-
-  while (control)
-  {
-uint32_t flags;
-int  f;
-int  fshowed;
-int  lf;
-
-fprintf (stdout, " ");
-rtems_monitor_dump_id (rtems_capture_control_id (control));
-fprintf (stdout, " ");
-rtems_monitor_dump_name (rtems_capture_control_name (control));
-flags = rtems_capture_control_flags (control);
-fprintf (stdout, " %c%c ",
- rtems_capture_watch_global_on () ? 'g' : '-',
- flags & RTEMS_CAPTURE_WATCH ? 'w' : '-');
-flags = rtems_capture_control_to_triggers (control);
-fprintf (stdout, " T:%c%c%c%c%c%c%c",
- flags & RTEMS_CAPTURE_SWITCH? 'S' : '-',
- flags & RTEMS_CAPTURE_CREATE ? 'C' : '-',
- flags & RTEMS_CAPTURE_START ? 'S' : '-',
- flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
- flags & RTEMS_CAPTURE_DELETE ? 'D' : '-',
- flags & RTEMS_CAPTURE_BEGIN ? 'B' : '-',
- flags & RTEMS_CAPTURE_EXITTED ? 'E' : '-');
-flags = rtems_capture_control_from_triggers (control);
-fprintf (stdout, " F:%c%c%c%c%c",
- flags & RTEMS_CAPTURE_SWITCH  ? 'S' : '-',
- flags & RTEMS_CAPTURE_CREATE  ? 'C' : '-',
- flags & RTEMS_CAPTURE_START   ? 'S' : '-',
- flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
- flags & RTEMS_CAPTURE_DELETE  ? 'D' : '-');
-
-for (f = 0, fshowed = 0, lf = 1; f < RTEMS_CAPTURE_TRIGGER_TASKS; f++)
-{
-  if (rtems_capture_control_by_valid (control, f))
-  {
-if (lf && ((fshowed % 3) == 0))
-{
-  fprintf (stdout, "\n");
-  lf = 0;
-}
-
-fprintf (stdout, "  %2i:", f);
-rtems_monitor_dump_name (rtems_capture_control_by_name (control, f));
-fprintf (stdout, "/");
-rtems_monitor_dump_id (rtems_capture_control_by_id (control, f));
-flags = rtems_capture_control_by_triggers (control, f);
-fprintf (stdout, ":%c%c%c%c%c",
- flags & RTEMS_CAPTURE_SWITCH  ? 'S' : '-',
- flags & RTEMS_CAPTURE_CREATE  ? 'C' : '-',
- flags & RTEMS_CAPTURE_START   ? 'S' : '-',
- flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
- flags & RTEMS_CAPTURE_DELETE  ? 'D' : '-');
-fshowed++;
-lf = 1;
-  }
-}
-
-if (lf)
-  fprintf (stdout, "\n");
-
-control = rtems_capture_next_control (control);
-  }
-}
-
-/*
- * rtems_catpure_cli_print_uptime
- *
- *  DESCRIPTION::148
- *
- *
- * This function prints the nanosecond uptime to stdout.
- */
-static void
-rtems_capture_cli_print_timestamp (uint64_t uptime)
-{
-  uint32_t hours;
-  uint32_t minutes;
-  uint32_t seconds;
-  uint32_t nanosecs;
-
-  seconds  = uptime / 10LLU;
-  minutes  = seconds / 60;
-  hours= minutes / 60;
-  minutes  = minutes % 60;
-  seconds  = seconds % 60;
-  nanosecs = uptime % 10;
-
-  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds, 
nanosecs);
-}
-static void
-rtems_caputre_cli_print_record_task(rtems_capture_record_t* rec)
-{
-  rtems_capture_task_record_t* task_rec = (rtems_capture_task_record_t*) rec;
-
-  rtems_capture_cli_print_timestamp (rec->time);
-  fprintf (stdout, "   ");
-  rtems_monitor_dump_id (rec->task_id);
-   fprintf (stdout, " %c%c%c%c",
-(char) (task_rec->name >> 24) & 0xff,
-(char) (task_rec->name >> 16) & 0xff,
-(char) (task_rec->name >> 8) & 0xff,
-(char) (task_rec->name >> 0) & 0xff);
-   fprintf (stdout, " %3" PRId32   " %3" PRId32 "\n",
-task_rec->start_priority,
-task_rec->stack_size);
-}
-
-static void
-rtems_caputure_cli_print_record_std(rtems_capture_record_t* rec, uint64_t diff)
-{
-  uint32_t event;
-  int  e;
-
-  event = rec->events >> RTEMS_CAPTURE_EVENT_START;
-
-  

smpcapture01 explanation and expected output.

2014-11-04 Thread Jennifer Averett
I was asked to post an explanation of the a test I just submitted for review 
(smpcapture01).  It is a new SMP test added that does a worst case migration of 
4 tasks on a 4 core system tracking and displaying the user extension records. 
This task is rather complex to describe but using the notation 
TaskName:Priority:{cpu,cpu} where the third portion indicates the CPUs the task 
has affinity for. The test starts with the initialization task (UT1:7:{2,3}) 
starting execution on CPU 3. This results in the following tasks assigned 
across the CPUs:

* CPUs 0-2: Idle threads

* CPU 3: UT1
The UT1 task creates four more tasks as follows:

* TA1:8:{2,3}

* TA2:5:{0,1}

* TA3:6:{0,3}

* TA3:9:{1}
This should result in the tasks being assigned to CPUs as follows:

* CPU 0: TA3

* CPU 1: TA2

* CPU 2: TA1

* CPU 3: UT1
TA4 should be ready to execute but waiting on a CPU it has affinity for to 
become available.
The test then raises the priority of TA4 to 4, resulting in the tasks being 
assigned to CPUs as follows:

* CPU 0: TA2

* CPU 1: TA4

* CPU 2: UT1

* CPU 3: TA3
At this point TA1 should still be ready to execute but is waiting on a CPU it 
has affinity for to become available.
The tasks are then terminated.  Additionally, the capture engine output shows 
that the migration that can occur during task termination adheres to the 
affinity settings.
The capture engine output of this test is as follows:
*** BEGIN OF TEST SMPCAPTURE 1 ***
1 0:00:00.0086530000a010003 TA02   5   5   5 4096  TASK_RECORD
0 0:00:00.0086590000a010004 TA03   6   6   6 4096  TASK_RECORD
2 0:00:00.0086630000a010002 TA01   8   8   8 4096  TASK_RECORD
1 0:00:00.008681000  0 0a0100035   5   SWITCHED_IN
0 0:00:00.008686000  0 0a0100046   6   SWITCHED_IN
2 0:00:00.008691000  0 0a0100028   8   SWITCHED_IN
1 0:00:00.008734000  53000 0a0100035   5   BEGIN
0 0:00:00.008738000  52000 0a0100046   6   BEGIN
2 0:00:00.008743000  52000 0a0100028   8   BEGIN
3 0:00:00.0089140000a010001 UI17   7   7 4096  TASK_RECORD
3 0:00:00.008943000  0 0a0100017   7   CREATED_BY
3 0:00:00.0090150000a010005 TA04   9   9   9 4096  TASK_RECORD
3 0:00:00.009041000  98000 0a0100059   9   CREATED
3 0:00:00.009298000 257000 0a0100017   7   STARTED_BY
3 0:00:00.009326000  28000 0a0100059   9   STARTED
3 0:00:01.000432000  991106000 0a0100017   7   SWITCHED_OUT
1 0:00:01.000452000  991718000 0a0100035   5   SWITCHED_OUT
3 0:00:01.000456000  24000 0a0100046   6   SWITCHED_IN
0 0:00:01.000473000  991735000 0a0100046   6   SWITCHED_OUT
1 0:00:01.000476000  24000 0a0100054   4   SWITCHED_IN
2 0:00:01.000491000  991748000 0a0100028   8   SWITCHED_OUT
0 0:00:01.000496000  23000 0a0100035   5   SWITCHED_IN
2 0:00:01.000514000  0 0a0100017   7   SWITCHED_IN
1 0:00:01.000527000  0 0a0100054   4   BEGIN
2 0:00:01.500426000  499912000 0a0100017   7   SWITCHED_OUT
2 0:00:01.50045  24000 0a0100027   7   SWITCHED_IN
2 0:00:01.500579000 129000 0a0100027   7   TERMINATED
2 0:00:01.500731000 152000 0a0100027   7   SWITCHED_OUT
2 0:00:01.500755000  24000 0a0100017   7   SWITCHED_IN
2 0:00:01.500966000 211000 0a0100017   7   SWITCHED_OUT
0 0:00:01.501049000  0 0a0100037   5   TERMINATED
2 0:00:01.501186000 22 0a0100017   7   SWITCHED_IN
0 0:00:01.50120 151000 0a0100037   5   SWITCHED_OUT
2 0:00:01.501391000 205000 0a0100017   7   SWITCHED_OUT
3 0:00:01.501476000  0 0a0100047   6   TERMINATED
3 0:00:01.501623000 147000 0a0100047   6   SWITCHED_OUT
3 0:00:01.501649000  26000 0a0100017   7   SWITCHED_IN
3 0:00:01.501867000 218000 0a0100017   7   SWITCHED_OUT
1 0:00:01.501945000  501418000 0a0100057   4   TERMINATED
3 0:00:01.502083000 216000 0a0100017   7   SWITCHED_IN
1 0:00:01.502136000 191000 0a0100057   4   SWITCHED_OUT
*** END OF TEST SMPCAPTURE 1 ***



___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: libdl: rtems.git dependence on rtems-tools.git

2014-11-04 Thread Joel Sherrill


On October 30, 2014 9:18:29 PM CDT, Gedare Bloom  wrote:
>On Thu, Oct 30, 2014 at 7:13 PM, Chris Johns  wrote:
>> On 31/10/2014 6:42 am, Gedare Bloom wrote:
>>>
>>> On Thu, Oct 30, 2014 at 3:40 PM, Gedare Bloom 
>wrote:

 On Thu, Oct 30, 2014 at 3:32 PM, Chris Johns 
>wrote:
>
> Hi,
>
> Libdl tests in the testsuite depend on tools in
>rtems-tools.git/linkers.
> Should I raise a configure error if the tools are not found or not
>build
> the
> tests ?
>
> Raising an error is my preferred option because libdl for the
>supported
> archs is tested however it creates a dependency between
>rtems-tools.git
> and
> RTEMS. I can help with this by adding building of rtems-tools.git
>to the
> RSB's build of RTEMS tools.
>
> Comments ?
>
 Only make it an error if building the rtems-tools/linker is part of
 the "standard" toolset builds, thus decreasing the burden on users
>who
 don't care to use libdl.
>>
>>
>> Yes. Libdl only builds for the architectures there is relocation
>support
>> for.
>>
>>> The documentation on self-built tools, and whatever process we have
>>> for the "authoritative tools" guide should include notes regarding
>>> this.
>>
>>
>> Sure. Do you have guide ?
>>
>Nope. There are some instructions under doc/started that come to mind.
>I don't know that we currently have a defined authoritative guide to
>building tools, as such.

That was the authoritative guide but needs updating. Probably greatly 
simplified. 

The primary recommendation for 4.11 is going to be RSB with some hints that 
there is support for some supporting programs and add on libraries for the 
target. This will be short and a series of pointers. 

Then some info on cloning RTEMS, and pointers.

I don't see mentioning instructions for hand building.  The arguments to the 
GCC configure are horribly long now. Many are Newlib specific for iconv 
settings. 

And I don't think we support binaries so that goes.

If there are windows specific advice, we can point them to help.

I think a very reduced getting started should exist. It has always been in the 
list of docs so something minimal with pointers needs to still be there.

>> Chris
>___
>devel mailing list
>devel@rtems.org
>http://lists.rtems.org/mailman/listinfo/devel

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 2/4] capture: Add SMP support.

2014-11-04 Thread Gedare Bloom
I was reviewing this code and lost my spot. There are some notes
below, but I have no more time to weed through. I'd recommend
splitting this patch into more pieces:
1) Moving code into capture_support.
2) Adding SMP support.
3) Fixing formatting/style/documentation issues in legacy portions.

Currently there are a mix of the three, and it makes reviewing the
changes quite complex. Anyway, there are some other notes below.


On Tue, Nov 4, 2014 at 8:39 AM, Jennifer Averett
 wrote:
> To support smp data was broken into global and percpu capture data.
> Capture control must be disabled prior to printing or setting of
> watch points.
>
> Methods to print the data were moved from capture-cli into
> a support area and are no longer static so that they can
> be shared by test routines, or application code that wants
> to use the capture engine without the shell interface.
> ---
>  cpukit/libmisc/Makefile.am  |   1 +
>  cpukit/libmisc/capture/capture-cli.c| 221 +
>  cpukit/libmisc/capture/capture-cli.h|   4 +-
>  cpukit/libmisc/capture/capture.c| 411 
> +---
>  cpukit/libmisc/capture/capture.h|  82 ++---
>  cpukit/libmisc/capture/capture_buffer.c |   6 +-
>  cpukit/libmisc/capture/capture_buffer.h |   6 +-
>  cpukit/libmisc/capture/capture_support.c| 307 ++
>  cpukit/libmisc/capture/capture_user_extension.c |  17 +-
>  cpukit/libmisc/capture/captureimpl.h| 102 --
>  10 files changed, 667 insertions(+), 490 deletions(-)
>  create mode 100644 cpukit/libmisc/capture/capture_support.c
>
> diff --git a/cpukit/libmisc/Makefile.am b/cpukit/libmisc/Makefile.am
> index 021a251..352379d 100644
> --- a/cpukit/libmisc/Makefile.am
> +++ b/cpukit/libmisc/Makefile.am
> @@ -19,6 +19,7 @@ EXTRA_DIST += capture/README
>  noinst_LIBRARIES += libcapture.a
>  libcapture_a_SOURCES = capture/capture.c capture/capture-cli.c \
>  capture/capture_user_extension.c capture/capture_buffer.c \
> +capture/capture_support.c \
>  capture/capture.h capture/captureimpl.h capture/capture-cli.h \
>  capture/capture_buffer.h
>
> diff --git a/cpukit/libmisc/capture/capture-cli.c 
> b/cpukit/libmisc/capture/capture-cli.c
> index ad53ccc..595c9cf 100644
> --- a/cpukit/libmisc/capture/capture-cli.c
> +++ b/cpukit/libmisc/capture/capture-cli.c
> @@ -5,7 +5,7 @@
>All rights reserved Objective Design Systems Pty Ltd, 2002
>Chris Johns (c...@acm.org)
>
> -  COPYRIGHT (c) 1989-1998.
> +  COPYRIGHT (c) 1989-2014.
>On-Line Applications Research Corporation (OAR).
>
>The license and distribution terms for this file may be
> @@ -41,6 +41,13 @@
>
>  #define RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS (20)
>
> +typedef struct {
> +  rtems_capture_record_t* rec;
> +  uint32_tread;
> +  uint32_tlast_t;
> +  uint32_tprinted;
> +} ctrace_per_cpu_t;
> +
This does not seem to belong here.

>  /*
>   * Counter used to count the number of active tasks.
>   */
> @@ -209,31 +216,6 @@ rtems_capture_cli_disable (int   
>  argc RC_UNUSED,
>fprintf (stdout, "capture engine disabled.\n");
>  }
>
> -/*
> - * rtems_catpure_cli_print_uptime
> - *
> - *  DESCRIPTION:
> - *
> - * This function prints the nanosecond uptime to stdout.
> - */
> -static void
> -rtems_capture_cli_print_timestamp (uint64_t uptime)
> -{
> -  uint32_t hours;
> -  uint32_t minutes;
> -  uint32_t seconds;
> -  uint32_t nanosecs;
> -
> -  seconds  = uptime / 10LLU;
> -  minutes  = seconds / 60;
> -  hours= minutes / 60;
> -  minutes  = minutes % 60;
> -  seconds  = seconds % 60;
> -  nanosecs = uptime % 10;
> -
> -  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds, 
> nanosecs);
> -}
> -
>  static void
>  rtems_capture_cli_print_task (rtems_tcb *tcb)
>  {
> @@ -273,47 +255,6 @@ rtems_capture_cli_print_task (rtems_tcb *tcb)
>}
>fprintf (stdout, "\n");
>  }
> -static void
> -rtems_caputure_cli_print_record_std(rtems_capture_record_t* rec, uint64_t 
> diff)
> -{
> -  uint32_t event;
> -  int  e;
> -
> -  event = rec->events >> RTEMS_CAPTURE_EVENT_START;
> -
> -  for (e = RTEMS_CAPTURE_EVENT_START; e < RTEMS_CAPTURE_EVENT_END; e++)
> -  {
> -if (event & 1)
> -{
> -  rtems_capture_cli_print_timestamp (rec->time);
> -  fprintf (stdout, " %9" PRId64 " ", diff);
> -  rtems_monitor_dump_id (rec->task_id);
> -  fprintf(stdout, "  %3" PRId32 " %3" PRId32 " %s\n",
> - (rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
> - (rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
> - rtems_capture_event_text (e));
> -}
> -event >>= 1;
> -  }
> -}
> -
> -static void
> -rtems_caputre_cli_print_record_task(rtems_capture_record_t* rec)
> -{
> -  rtems_capture_task_record_t* task_rec = (rtems_capture_t

Re: [PATCH] (2 commits squashed into one) Beagle BSP for review

2014-11-04 Thread Ben Gras
I just checked, it runs on the bbxm hardware too, not just the emulator.


On Mon, Nov 3, 2014 at 1:20 PM, Ben Gras  wrote:

> All,
>
> Ok, as promised, I rebased and re-tested and have found & included a
> portable way of making the SD card image (included in sdcard.sh), to be
> merged with RSB (i.e. some of the tools sdcard.sh relies on are missing in
> mainline RSB). Some of Gedare's initial feedback is processed thanks to
> Brandon Matthews. It's tested to run on the original beaglebone, beaglebone
> black and qemu linaro. (The assumption is it'll run on the bbxm hardware as
> well as it was before rebasing.)
>
> The result is split into 2 patches to show what was Claas's initial work.
> This makes them a bit unreadable for the final result from the patches
> unfortunately.
>
> As before, see
> http://www.shrike-systems.com/beagleboard-xm-beaglebone-black-and-everything-else-rtems-on-the-beagles.html
> on how to build all the tools, RTEMS executables, sdcard images, and run
> the test set from linaro qemu.
>
>
>
> On Sat, Aug 30, 2014 at 5:50 PM, Ben Gras  wrote:
>
>> All,
>>
>> OK, that seems like a fruitful way to proceed to me.
>>
>> Then I will do some minor cleanups, rebase, do all the tests again, and
>> re-submit. There's just one problem I know of that I want to fix before the
>> first commit happens, and that is that the FAT fs made by mtools doesn't
>> boot on the HW it seems. (It does on the emulator.) A last-minute change -
>> switching to mtools instead of dosfstools to use to make the SD card image
>> because the latter is so linux-only.
>>
>> Stay tuned.
>>
>>
>>
>>
>> On Wed, Aug 20, 2014 at 4:20 PM, Gedare Bloom  wrote:
>>
>>> Ben, As far as getting this merged, all of my comments can be done as
>>> a follow-on commit. -Gedare
>>>
>>> On Thu, Jul 24, 2014 at 4:28 PM, Ben Gras 
>>> wrote:
>>> > Thanks for the fast & detailed review. Let me get back to it/you.
>>> >
>>> > In the meantime, any other feedback? From anyone I mean.
>>> >
>>> >
>>> >
>>> > On Thu, Jul 24, 2014 at 4:45 PM, Gedare Bloom 
>>> wrote:
>>> >>
>>> >> Hi Ben,
>>> >> Great work. I have a few comments. I skipped the i2c.h and i2c.c
>>> >> files. Most of my comments are about style and a few requests to
>>> >> refactor some of the larger files. The refactoring can be added to
>>> >> your TODO if you like. Please fix the style issues if it is not a
>>> >> burden.
>>> >>
>>> >> +++ b/c/src/lib/libbsp/arm/beagle/README
>>> >> +$ ../claas-rtems/configure --target=arm-rtems4.11
>>> >> --enable-rtemsbsp="beaglebonewhite beagleboardxm"
>>> >> Replace claas-rtems with rtems. If RSB support is available, make a
>>> >> note about it.
>>> >>
>>> >> +++ b/c/src/lib/libbsp/arm/beagle/TODO
>>> >> [...]
>>> >> open:
>>> >> + . how to handle the interrupt?
>>> >>
>>> >> What does this mean?
>>> >>
>>> >> +++ b/c/src/lib/libbsp/arm/beagle/clock.c
>>> >> Why is the entire file ifdef'd on ARM_MULTILIB_ARCH_V4?
>>> >>
>>> >> It might be sensible to put the struct definitions in a .h file if
>>> >> these omap registers might be re-usable.
>>> >>
>>> >> +static struct omap_timer_registers regs_v2 = {
>>> >> This might be better to put behind an #if IS_AM335X since it is not
>>> >> used otherwise?
>>> >>
>>> >> +
>>> >> +
>>> >> +
>>> >> Avoid more than one blank line in a row.
>>> >>
>>> >> +static int done = 0;
>>> >> It would be nice if you got rid of this, but otherwise give it a more
>>> >> useful name like "mmio_init_done"
>>> >>
>>> >> +static void beagle_clock_handler_install(rtems_interrupt_handler isr)
>>> >> +  if (sc != RTEMS_SUCCESSFUL) {
>>> >> +rtems_fatal_error_occurred(0xdeadbeef);
>>> >> I think there is some capabilities in ARM for bsp fatal error codes
>>> >> now. They should be preferred to be used to help debug these fatal
>>> >> conditions.
>>> >>
>>> >> +static inline uint32_t beagle_clock_nanoseconds_since_last_tick(void)
>>> >> +  return (read_frc() - (uint64_t) last_tick_nanoseconds) * 10
>>> >> / FRCLOCK_HZ;
>>> >> This line is > 80 characters, please break it or shrink it.
>>> >>
>>> >> +++ b/c/src/lib/libbsp/arm/beagle/console/console-config.c
>>> >> +#define CONSOLE_UART_LSR (*(volatile unsigned int
>>> >> *)(BSP_CONSOLE_UART_BASE+0x14))
>>> >> Line > 80 characters, even with the spacing modified.
>>> >>
>>> >> +static void beagle_console_init(void)
>>> >>
>>> >> +while ((CONSOLE_SYSS & 1) == 0)
>>> >> +  ;
>>> >> Is this a fatal loop or is it waiting for hardware to clear something?
>>> >>
>>> >> +if ((CONSOLE_LSR & (CONSOLE_LSR_THRE | CONSOLE_LSR_TEMT)) ==
>>> >> CONSOLE_LSR_THRE) {
>>> >> Again > 80 characters. Is the test logically equivalent to: if (
>>> >> (CONSOLE_LSR & CONSOLE_LSR_THRE) == CONSOLE_LSR_THRE)
>>> >>
>>> >> +while ((CONSOLE_LSR & CONSOLE_LSR_TEMT) == 0)
>>> >> +  ;
>>> >> Is this a fatal loop or is it waiting for hardware?
>>> >>
>>> >> +++ b/c/src/lib/libbsp/arm/beagle/include/bsp.h
>>> >> This bsp.h is really long. Probably it should be refactored into othe

Re: [PATCH 3/4] capture01: Add SMP support into capture engine.

2014-11-04 Thread Gedare Bloom
The commit message is a bit too vague and maybe misleading. It should
reflect this changes the capture test to use the SMP support
-Gedare

On Tue, Nov 4, 2014 at 8:39 AM, Jennifer Averett
 wrote:
> ---
>  testsuites/libtests/capture01/init.c | 249 
> ++-
>  1 file changed, 12 insertions(+), 237 deletions(-)
>
> diff --git a/testsuites/libtests/capture01/init.c 
> b/testsuites/libtests/capture01/init.c
> index a725e26..e1e1e84 100644
> --- a/testsuites/libtests/capture01/init.c
> +++ b/testsuites/libtests/capture01/init.c
> @@ -33,229 +33,6 @@ rtems_task Init(rtems_task_argument argument);
>
>  const char rtems_test_name[] = "CAPTURE 1";
>
> -static void cwlist(void);
> -static void ctrace(void);
> -
> -static void cwlist ()
> -{
> -  rtems_capture_control_t* control = rtems_capture_get_control_list ();
> -  rtems_task_priority  ceiling = rtems_capture_watch_get_ceiling ();
> -  rtems_task_priority  floor = rtems_capture_watch_get_floor ();
> -
> -  fprintf (stdout, "watch priority ceiling is %" PRId32 "\n", ceiling);
> -  fprintf (stdout, "watch priority floor is %" PRId32 "\n", floor);
> -  fprintf (stdout, "global watch is %s\n",
> -  rtems_capture_watch_global_on () ? "enabled" : "disabled");
> -  fprintf (stdout, "total %" PRId32 "\n", rtems_capture_control_count ());
> -
> -  while (control)
> -  {
> -uint32_t flags;
> -int  f;
> -int  fshowed;
> -int  lf;
> -
> -fprintf (stdout, " ");
> -rtems_monitor_dump_id (rtems_capture_control_id (control));
> -fprintf (stdout, " ");
> -rtems_monitor_dump_name (rtems_capture_control_name (control));
> -flags = rtems_capture_control_flags (control);
> -fprintf (stdout, " %c%c ",
> - rtems_capture_watch_global_on () ? 'g' : '-',
> - flags & RTEMS_CAPTURE_WATCH ? 'w' : '-');
> -flags = rtems_capture_control_to_triggers (control);
> -fprintf (stdout, " T:%c%c%c%c%c%c%c",
> - flags & RTEMS_CAPTURE_SWITCH? 'S' : '-',
> - flags & RTEMS_CAPTURE_CREATE ? 'C' : '-',
> - flags & RTEMS_CAPTURE_START ? 'S' : '-',
> - flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
> - flags & RTEMS_CAPTURE_DELETE ? 'D' : '-',
> - flags & RTEMS_CAPTURE_BEGIN ? 'B' : '-',
> - flags & RTEMS_CAPTURE_EXITTED ? 'E' : '-');
> -flags = rtems_capture_control_from_triggers (control);
> -fprintf (stdout, " F:%c%c%c%c%c",
> - flags & RTEMS_CAPTURE_SWITCH  ? 'S' : '-',
> - flags & RTEMS_CAPTURE_CREATE  ? 'C' : '-',
> - flags & RTEMS_CAPTURE_START   ? 'S' : '-',
> - flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
> - flags & RTEMS_CAPTURE_DELETE  ? 'D' : '-');
> -
> -for (f = 0, fshowed = 0, lf = 1; f < RTEMS_CAPTURE_TRIGGER_TASKS; f++)
> -{
> -  if (rtems_capture_control_by_valid (control, f))
> -  {
> -if (lf && ((fshowed % 3) == 0))
> -{
> -  fprintf (stdout, "\n");
> -  lf = 0;
> -}
> -
> -fprintf (stdout, "  %2i:", f);
> -rtems_monitor_dump_name (rtems_capture_control_by_name (control, f));
> -fprintf (stdout, "/");
> -rtems_monitor_dump_id (rtems_capture_control_by_id (control, f));
> -flags = rtems_capture_control_by_triggers (control, f);
> -fprintf (stdout, ":%c%c%c%c%c",
> - flags & RTEMS_CAPTURE_SWITCH  ? 'S' : '-',
> - flags & RTEMS_CAPTURE_CREATE  ? 'C' : '-',
> - flags & RTEMS_CAPTURE_START   ? 'S' : '-',
> - flags & RTEMS_CAPTURE_RESTART ? 'R' : '-',
> - flags & RTEMS_CAPTURE_DELETE  ? 'D' : '-');
> -fshowed++;
> -lf = 1;
> -  }
> -}
> -
> -if (lf)
> -  fprintf (stdout, "\n");
> -
> -control = rtems_capture_next_control (control);
> -  }
> -}
> -
> -/*
> - * rtems_catpure_cli_print_uptime
> - *
> - *  DESCRIPTION::148
> - *
> - *
> - * This function prints the nanosecond uptime to stdout.
> - */
> -static void
> -rtems_capture_cli_print_timestamp (uint64_t uptime)
> -{
> -  uint32_t hours;
> -  uint32_t minutes;
> -  uint32_t seconds;
> -  uint32_t nanosecs;
> -
> -  seconds  = uptime / 10LLU;
> -  minutes  = seconds / 60;
> -  hours= minutes / 60;
> -  minutes  = minutes % 60;
> -  seconds  = seconds % 60;
> -  nanosecs = uptime % 10;
> -
> -  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds, 
> nanosecs);
> -}
> -static void
> -rtems_caputre_cli_print_record_task(rtems_capture_record_t* rec)
> -{
> -  rtems_capture_task_record_t* task_rec = (rtems_capture_task_record_t*) rec;
> -
> -  rtems_capture_cli_print_timestamp (rec->time);
> -  fprintf (stdout, "   ");
> -  rtems_monitor_dump_id (rec->task_id);
> -   fprintf (stdout, " %c%c%c%c",
> -(char) (task_rec->name >> 24) & 0xff,
> -(char) (task_rec->name >> 16) & 0xff,
> - 

Re: smpcapture01 explanation and expected output.

2014-11-04 Thread Gedare Bloom
Thanks, I was going to ask for more explanation on that patch itself.
This documentation should accompany the test-case.

-Gedare

On Tue, Nov 4, 2014 at 9:22 AM, Jennifer Averett
 wrote:
> I was asked to post an explanation of the a test I just submitted for review
> (smpcapture01).  It is a new SMP test added that does a worst case migration
> of 4 tasks on a 4 core system tracking and displaying the user extension
> records. This task is rather complex to describe but using the notation
> TaskName:Priority:{cpu,cpu} where the third portion indicates the CPUs the
> task has affinity for. The test starts with the initialization task
> (UT1:7:{2,3}) starting execution on CPU 3. This results in the following
> tasks assigned across the CPUs:
>
> · CPUs 0-2: Idle threads
>
> · CPU 3: UT1
>
> The UT1 task creates four more tasks as follows:
>
> · TA1:8:{2,3}
>
> · TA2:5:{0,1}
>
> · TA3:6:{0,3}
>
> · TA3:9:{1}
>
> This should result in the tasks being assigned to CPUs as follows:
>
> · CPU 0: TA3
>
> · CPU 1: TA2
>
> · CPU 2: TA1
>
> · CPU 3: UT1
>
> TA4 should be ready to execute but waiting on a CPU it has affinity for to
> become available.
>
> The test then raises the priority of TA4 to 4, resulting in the tasks being
> assigned to CPUs as follows:
>
> · CPU 0: TA2
>
> · CPU 1: TA4
>
> · CPU 2: UT1
>
> · CPU 3: TA3
>
> At this point TA1 should still be ready to execute but is waiting on a CPU
> it has affinity for to become available.
>
> The tasks are then terminated.  Additionally, the capture engine output
> shows that the migration that can occur during task termination adheres to
> the affinity settings.
>
> The capture engine output of this test is as follows:
>
> *** BEGIN OF TEST SMPCAPTURE 1 ***
>
> 1 0:00:00.0086530000a010003 TA02   5   5   5 4096
> TASK_RECORD
>
> 0 0:00:00.0086590000a010004 TA03   6   6   6 4096
> TASK_RECORD
>
> 2 0:00:00.0086630000a010002 TA01   8   8   8 4096
> TASK_RECORD
>
> 1 0:00:00.008681000  0 0a0100035   5
> SWITCHED_IN
>
> 0 0:00:00.008686000  0 0a0100046   6
> SWITCHED_IN
>
> 2 0:00:00.008691000  0 0a0100028   8
> SWITCHED_IN
>
> 1 0:00:00.008734000  53000 0a0100035   5   BEGIN
>
> 0 0:00:00.008738000  52000 0a0100046   6   BEGIN
>
> 2 0:00:00.008743000  52000 0a0100028   8   BEGIN
>
> 3 0:00:00.0089140000a010001 UI17   7   7 4096
> TASK_RECORD
>
> 3 0:00:00.008943000  0 0a0100017   7
> CREATED_BY
>
> 3 0:00:00.0090150000a010005 TA04   9   9   9 4096
> TASK_RECORD
>
> 3 0:00:00.009041000  98000 0a0100059   9   CREATED
>
> 3 0:00:00.009298000 257000 0a0100017   7
> STARTED_BY
>
> 3 0:00:00.009326000  28000 0a0100059   9   STARTED
>
> 3 0:00:01.000432000  991106000 0a0100017   7
> SWITCHED_OUT
>
> 1 0:00:01.000452000  991718000 0a0100035   5
> SWITCHED_OUT
>
> 3 0:00:01.000456000  24000 0a0100046   6
> SWITCHED_IN
>
> 0 0:00:01.000473000  991735000 0a0100046   6
> SWITCHED_OUT
>
> 1 0:00:01.000476000  24000 0a0100054   4
> SWITCHED_IN
>
> 2 0:00:01.000491000  991748000 0a0100028   8
> SWITCHED_OUT
>
> 0 0:00:01.000496000  23000 0a0100035   5
> SWITCHED_IN
>
> 2 0:00:01.000514000  0 0a0100017   7
> SWITCHED_IN
>
> 1 0:00:01.000527000  0 0a0100054   4   BEGIN
>
> 2 0:00:01.500426000  499912000 0a0100017   7
> SWITCHED_OUT
>
> 2 0:00:01.50045  24000 0a0100027   7
> SWITCHED_IN
>
> 2 0:00:01.500579000 129000 0a0100027   7
> TERMINATED
>
> 2 0:00:01.500731000 152000 0a0100027   7
> SWITCHED_OUT
>
> 2 0:00:01.500755000  24000 0a0100017   7
> SWITCHED_IN
>
> 2 0:00:01.500966000 211000 0a0100017   7
> SWITCHED_OUT
>
> 0 0:00:01.501049000  0 0a0100037   5
> TERMINATED
>
> 2 0:00:01.501186000 22 0a0100017   7
> SWITCHED_IN
>
> 0 0:00:01.50120 151000 0a0100037   5
> SWITCHED_OUT
>
> 2 0:00:01.501391000 205000 0a0100017   7
> SWITCHED_OUT
>
> 3 0:00:01.501476000  0 0a0100047   6
> TERMINATED
>
> 3 0:00:01.501623000 147000 0a0100047   6
> SWITCHED_OUT
>
> 3 0:00:01.501649000  26000 0a0100017   7
> SWITCHED_IN
>
> 3 0:00:01.501867000 218000 0a0100017   7
> SWITCHED_OUT
>
> 1 0:00:01.501945000  501418000 0a0100057   4
> TERMINATED
>
> 3 0:00:01.502083000 216000 0a0100017   7
> SWITCHED_IN
>
> 1 0:00:01.502136000 191000 0a0100057   4
> SWITCHED_OUT
>
> *** END

RE: [PATCH 2/4] capture: Add SMP support.

2014-11-04 Thread Jennifer Averett


> -Original Message-
> From: ged...@gwmail.gwu.edu [mailto:ged...@gwmail.gwu.edu] On
> Behalf Of Gedare Bloom
> Sent: Tuesday, November 04, 2014 10:16 AM
> To: Jennifer Averett
> Cc: rtems-de...@rtems.org
> Subject: Re: [PATCH 2/4] capture: Add SMP support.
>
> I was reviewing this code and lost my spot. There are some notes
> below, but I have no more time to weed through. I'd recommend
> splitting this patch into more pieces:
> 1) Moving code into capture_support.
> 2) Adding SMP support.
> 3) Fixing formatting/style/documentation issues in legacy portions.
>
> Currently there are a mix of the three, and it makes reviewing the
> changes quite complex. Anyway, there are some other notes below.
>
>
> On Tue, Nov 4, 2014 at 8:39 AM, Jennifer Averett
>  wrote:
> > To support smp data was broken into global and percpu capture data.
> > Capture control must be disabled prior to printing or setting of
> > watch points.
> >
> > Methods to print the data were moved from capture-cli into
> > a support area and are no longer static so that they can
> > be shared by test routines, or application code that wants
> > to use the capture engine without the shell interface.
> > ---
> >  cpukit/libmisc/Makefile.am  |   1 +
> >  cpukit/libmisc/capture/capture-cli.c| 221 +
> >  cpukit/libmisc/capture/capture-cli.h|   4 +-
> >  cpukit/libmisc/capture/capture.c| 411 
> > +---
> >  cpukit/libmisc/capture/capture.h|  82 ++---
> >  cpukit/libmisc/capture/capture_buffer.c |   6 +-
> >  cpukit/libmisc/capture/capture_buffer.h |   6 +-
> >  cpukit/libmisc/capture/capture_support.c| 307
> ++
> >  cpukit/libmisc/capture/capture_user_extension.c |  17 +-
> >  cpukit/libmisc/capture/captureimpl.h| 102 --
> >  10 files changed, 667 insertions(+), 490 deletions(-)
> >  create mode 100644 cpukit/libmisc/capture/capture_support.c
> >
> > diff --git a/cpukit/libmisc/Makefile.am b/cpukit/libmisc/Makefile.am
> > index 021a251..352379d 100644
> > --- a/cpukit/libmisc/Makefile.am
> > +++ b/cpukit/libmisc/Makefile.am
> > @@ -19,6 +19,7 @@ EXTRA_DIST += capture/README
> >  noinst_LIBRARIES += libcapture.a
> >  libcapture_a_SOURCES = capture/capture.c capture/capture-cli.c \
> >  capture/capture_user_extension.c capture/capture_buffer.c \
> > +capture/capture_support.c \
> >  capture/capture.h capture/captureimpl.h capture/capture-cli.h \
> >  capture/capture_buffer.h
> >
> > diff --git a/cpukit/libmisc/capture/capture-cli.c
> b/cpukit/libmisc/capture/capture-cli.c
> > index ad53ccc..595c9cf 100644
> > --- a/cpukit/libmisc/capture/capture-cli.c
> > +++ b/cpukit/libmisc/capture/capture-cli.c
> > @@ -5,7 +5,7 @@
> >All rights reserved Objective Design Systems Pty Ltd, 2002
> >Chris Johns (c...@acm.org)
> >
> > -  COPYRIGHT (c) 1989-1998.
> > +  COPYRIGHT (c) 1989-2014.
> >On-Line Applications Research Corporation (OAR).
> >
> >The license and distribution terms for this file may be
> > @@ -41,6 +41,13 @@
> >
> >  #define RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS (20)
> >
> > +typedef struct {
> > +  rtems_capture_record_t* rec;
> > +  uint32_tread;
> > +  uint32_tlast_t;
> > +  uint32_tprinted;
> > +} ctrace_per_cpu_t;
> > +
> This does not seem to belong here.

Removed

> >  /*
> >   * Counter used to count the number of active tasks.
> >   */
> > @@ -209,31 +216,6 @@ rtems_capture_cli_disable (int 
> >argc
> RC_UNUSED,
> >fprintf (stdout, "capture engine disabled.\n");
> >  }
> >
> > -/*
> > - * rtems_catpure_cli_print_uptime
> > - *
> > - *  DESCRIPTION:
> > - *
> > - * This function prints the nanosecond uptime to stdout.
> > - */
> > -static void
> > -rtems_capture_cli_print_timestamp (uint64_t uptime)
> > -{
> > -  uint32_t hours;
> > -  uint32_t minutes;
> > -  uint32_t seconds;
> > -  uint32_t nanosecs;
> > -
> > -  seconds  = uptime / 10LLU;
> > -  minutes  = seconds / 60;
> > -  hours= minutes / 60;
> > -  minutes  = minutes % 60;
> > -  seconds  = seconds % 60;
> > -  nanosecs = uptime % 10;
> > -
> > -  fprintf (stdout, "%5lu:%02lu:%02lu.%09lu", hours, minutes, seconds,
> nanosecs);
> > -}
> > -
> >  static void
> >  rtems_capture_cli_print_task (rtems_tcb *tcb)
> >  {
> > @@ -273,47 +255,6 @@ rtems_capture_cli_print_task (rtems_tcb *tcb)
> >}
> >fprintf (stdout, "\n");
> >  }
> > -static void
> > -rtems_caputure_cli_print_record_std(rtems_capture_record_t* rec,
> uint64_t diff)
> > -{
> > -  uint32_t event;
> > -  int  e;
> > -
> > -  event = rec->events >> RTEMS_CAPTURE_EVENT_START;
> > -
> > -  for (e = RTEMS_CAPTURE_EVENT_START; e <
> RTEMS_CAPTURE_EVENT_END; e++)
> > -  {
> > -if (event & 1)
> > -{
> > -  rtems_capture_cli_print_timestamp (rec->time);
> > -  fprintf (std

raspberry pi and dl01

2014-11-04 Thread Joel Sherrill
Hi

Looks like a weak symbol issue with the loader:

arm-rtems4.11-gcc -B../../../../../raspberrypi/lib/ -specs bsp_specs
-qrtems -mcpu=arm1176jzf-s -O2 -g -Wall -Wmissing-prototypes
-Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs   
-mcpu=arm1176jzf-s   \
-o dl01.exe init.o dl-load.o dl-tar.o dl-sym.o
../../../../../raspberrypi/lib/librtemsbsp.a(libbsp_a-irq.o): In
function `bsp_interrupt_handler_default':
/users/joel/rtems-4.11-work/rtems-testing/rtems/build-arm-raspberrypi-rtems/arm-rtems4.11/c/raspberrypi/lib/libbsp/arm/raspberrypi/../../../../../../../../rtems/c/src/lib/libbsp/arm/raspberrypi/irq/irq.c:116:
multiple definition of `bsp_interrupt_handler_default'
../../../../../raspberrypi/lib/librtemsbsp.a(libbsp_a-irq-default-handler.o):/users/joel/rtems-4.11-work/rtems-testing/rtems/build-arm-raspberrypi-rtems/arm-rtems4.11/c/raspberrypi/lib/libbsp/arm/raspberrypi/../../../../../../../../rtems/c/src/lib/libbsp/arm/raspberrypi/../../shared/src/irq-default-handler.c:20:
first defined here
collect2: error: ld returned 1 exit status

-- 
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherr...@oarcorp.comOn-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available(256) 722-9985

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: RTEMS+LWIP for LPC1768 BSP

2014-11-04 Thread Marcos Díaz
Hi!
 We are currently using a LWIP implementation on the Beagle Bone Black bsp,
recently uploaded by Ben Gras.
We developed this port based on ethernet and lwip drivers from StarterWare
drivers of Texas Instrument.
We took this port, that was intended for baremetal use and added a posix
implementation, as Federico did for the semaphores, messages and threads to
use inside LWIP and the driver, and updated LWIP version to the current
working branch.
We also modified the device driver in order to support threads in charge of
managing the input and output of the device.
The license for those drivers is BSD and copied from the LWIP's BSD license.

Now we are using this port as an application, but we wanted to have ideas
of how we can put LWIP inside RTEMS.
I'm thinking of many things, as:
 initialization of the device
configuration of lwip options and ip address options
use of socket api and integrating it to the libraries used in RTEMS.

So, we want to get some ideas as when and where we can set this
configurations and functions inside RTEMS.
Thanks, and feel free to ask any questions about the work we did.

On Thu, Aug 28, 2014 at 2:27 PM, Federico Casares <
federico.casa...@tallertechnologies.com> wrote:

> Hi,
>
> On Tue, Aug 26, 2014 at 3:46 PM, Joel Sherrill 
> wrote:
>
>>  First. Thanks for the work and taking the time and effort to
>> submit it.
>>
>> Specifics below, but the general answer is to submit all RTEMS
>> changes as reviewable patches to devel@rtems.org. We can
>> then review them and get them merged. This will leave us
>> with just the LWIP changes.
>>
>> Then we can review those and begin to work with that community
>> to get them merged.
>>
>>
>>
>> On 8/26/2014 6:22 AM, Federico Casares wrote:
>>
>> Hi,
>>
>> In the past weeks we were working on porting the last LWIP version to
>> RTEMS for
>> the LPC1768 microcontroller. Our main goal was to accomplish this with the
>> minimum number of changes for both projects. Fortunately, the result was
>> positive.
>>
>> Now, we are capable of providing to the community with this new version
>> of the
>> RTEMS+LWIP port. In details:
>>
>> - RTEMS: last git revision = baa3c91ecb8a3b48ef387b938fcdb6
>> e60b5bdc8a
>> - LWIP: last git revision = 63038e03055183e3bc043711ada1de3bb907e989
>> - LPC1768: based on MBED driver =
>> https://github.com/mbedmicro/mbed/tree/master/libraries/net/eth/lwip-eth/arch/TARGET_NXP
>>
>>
>> The list of changes follows:
>>
>> - RTEMS OS: No changes were needed here. Despite this we will be posting a
>> possible improvement in the newlib maillist soon. It consist in adding
>> the gcc
>> function attribute "warn_unused_result" to the pthread_*_init functions.
>> As a
>> result, developers will be warned about checking the return value. NOTE: a
>> common error here could be not checking the return value, assuming a
>> successful
>> result, and trying to, for example, lock a mutex which init function has
>> returned ENOMEM. (We found this exact mistake in the current LWIP OS layer
>> implementation for Unix)
>>
>>   FWIW the gcc C++ library adapters for threading do not check the
>> results from
>> those operations. This is an open sore spot for us.
>>
>>  - RTEMS LPC1768_MBED BSP: We added a new section to the linker script,
>> so we
>> were able to put the LWIP and driver buffers in an exact memory location
>> (useful
>> when working with DMA devices).
>>
>>   This sounds like a discrete patch to submit to devel@rtems.org.
>>
>> Already sent.
>
>>   - RTEMS LPC1768_MBED Ethernet Driver: Based on an existing driver from
>> MBED, we
>> ported it to RTEMS. NOTE: we will be creating our own driver in the near
>> future.
>>
>>   What is the license of these drivers?
>>
>> GPLv2. Is this ok?
>
>>   - LWIP: As mentioned previously, we needed to put all LWIP buffers in
>> DMA memory
>> locations. Consequently, we added the "section" attribute to LWIP
>> ram_heap and
>> memp_memory buffers. Furthermore, as this is a common strategy in embedded
>> devices with DMA, we made it generic and we will send these changes to
>> the LWIP
>> project. Additionally, we will provide some minor adds/changes to the
>> lwip log
>> system and statistics system.
>>
>>   OK. Those are obviously their's to review. :)
>>
>>  - LWIP-contrib: Some of the changes/adds were: fixing some issues
>> related with
>> posix initialization checks and allow set threads stack size.
>>
>>   What all specific to RTEMS was added? Do you want RTEMS Community
>> review
>> on this?
>>
>> Is there a readme/howto to configure and use LWIP on RTEMS?
>>
>> It sounds like the port is largely BSP independent. Is this the case?
>>
>> See below.
>
>>   - LWIP-test-app: A simple TCP echo server with debugging functionality
>> (rtems malloc statistics, rtems stack checker, lwip statistics, driver
>> statistics and registers dump) available.
>>
>>   Very cool!
>>
>> How large was the code/data/RAM use of the test application?
>>
>> $ arm-rtems4.11-size -A -d o-optimize/lwip.exe
>
> o-o

[PATCH 3/7] sapi/src/testextension.c: Fix warnings

2014-11-04 Thread Joel Sherrill
---
 cpukit/sapi/src/testextension.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/sapi/src/testextension.c b/cpukit/sapi/src/testextension.c
index e1a1985..f59ae0d 100644
--- a/cpukit/sapi/src/testextension.c
+++ b/cpukit/sapi/src/testextension.c
@@ -19,10 +19,12 @@
 #include 
 #include 
 
+#if defined(RTEMS_PROFILING)
 static bool report_done;
 
 static rtems_interrupt_lock report_lock =
   RTEMS_INTERRUPT_LOCK_INITIALIZER( "test report" );
+#endif
 
 void rtems_test_fatal_extension(
   rtems_fatal_source source,
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/7] libdl/rtl-mdreloc-bfin.c: Include rtems/rtl/rtl.h not rtl.h

2014-11-04 Thread Joel Sherrill
---
 cpukit/libdl/rtl-mdreloc-bfin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libdl/rtl-mdreloc-bfin.c b/cpukit/libdl/rtl-mdreloc-bfin.c
index 1c9fd5b..d855d30 100644
--- a/cpukit/libdl/rtl-mdreloc-bfin.c
+++ b/cpukit/libdl/rtl-mdreloc-bfin.c
@@ -1,7 +1,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include "rtl-elf.h"
 #include "rtl-error.h"
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 6/7] lpc2362-testsuite.tcfg: Add dl01

2014-11-04 Thread Joel Sherrill
---
 c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc2362-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc2362-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc2362-testsuite.tcfg
index 46897d4..1559e3d 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc2362-testsuite.tcfg
+++ b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc2362-testsuite.tcfg
@@ -6,6 +6,7 @@
 
 capture
 cdtest
+dl01
 fileio
 flashdisk01
 fsdosfsname01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/7] libdl/Makefile.am: Need preinstall on all targets

2014-11-04 Thread Joel Sherrill
---
 cpukit/libdl/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/libdl/Makefile.am b/cpukit/libdl/Makefile.am
index 11f1478..5c3cd15 100644
--- a/cpukit/libdl/Makefile.am
+++ b/cpukit/libdl/Makefile.am
@@ -30,7 +30,7 @@ libdl_a_SOURCES = \
 libdl_a_SOURCES += rtl-mdreloc-@RTEMS_CPU@.c
 libdl_a_CPPFLAGS = $(AM_CPPFLAGS) -DRTEMS_RTL_RAP_LOADER=1 
-DRTEMS_RTL_ELF_LOADER=1
 
+endif
+
 include $(srcdir)/preinstall.am
 include $(top_srcdir)/automake/local.am
-
-endif
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 7/7] lpc23xx_tli800-testsuite.tcfg: Add dl01

2014-11-04 Thread Joel Sherrill
---
 c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc23xx_tli800-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc23xx_tli800-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc23xx_tli800-testsuite.tcfg
index b63ed50..5d303a9 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc23xx_tli800-testsuite.tcfg
+++ b/c/src/lib/libbsp/arm/lpc24xx/make/custom/lpc23xx_tli800-testsuite.tcfg
@@ -6,6 +6,7 @@
 
 capture
 cdtest
+dl01
 fileio
 flashdisk01
 fsdosfsformat01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 5/7] lpc1768_mbed_ahb_ram_eth-testsuite.tcfg: Add rbheap01

2014-11-04 Thread Joel Sherrill
---
 .../arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
index 8d4c215..a9bfaf4 100644
--- 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
+++ 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
@@ -17,6 +17,7 @@ jffs2_fssymlink
 jffs2_fstime
 mghttpd01
 pppd
+rbheap01
 spstkalloc02
 utf8proc01
 iostream
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 4/7] lm3s3749-testsuite.tcfg: Add dl01

2014-11-04 Thread Joel Sherrill
---
 c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
index bc92170..30aaea0 100644
--- a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
+++ b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
@@ -6,6 +6,7 @@
 
 capture
 iostream
+dl01
 ftp01
 fileio
 flashdisk01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 1/7] libdl/Makefile.am: Need preinstall on all targets

2014-11-04 Thread Chris Johns

Hi Joel,

These look fine.

Chris

On 5/11/2014 8:25 am, Joel Sherrill wrote:

---
  cpukit/libdl/Makefile.am | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/libdl/Makefile.am b/cpukit/libdl/Makefile.am
index 11f1478..5c3cd15 100644
--- a/cpukit/libdl/Makefile.am
+++ b/cpukit/libdl/Makefile.am
@@ -30,7 +30,7 @@ libdl_a_SOURCES = \
  libdl_a_SOURCES += rtl-mdreloc-@RTEMS_CPU@.c
  libdl_a_CPPFLAGS = $(AM_CPPFLAGS) -DRTEMS_RTL_RAP_LOADER=1 
-DRTEMS_RTL_ELF_LOADER=1

+endif
+
  include $(srcdir)/preinstall.am
  include $(top_srcdir)/automake/local.am
-
-endif


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 1/7] libdl/Makefile.am: Need preinstall on all targets

2014-11-04 Thread Joel Sherrill

On 11/4/2014 3:29 PM, Chris Johns wrote:
> Hi Joel,
>
> These look fine.
All of these patches?

--joel
> Chris
>
> On 5/11/2014 8:25 am, Joel Sherrill wrote:
>> ---
>>   cpukit/libdl/Makefile.am | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpukit/libdl/Makefile.am b/cpukit/libdl/Makefile.am
>> index 11f1478..5c3cd15 100644
>> --- a/cpukit/libdl/Makefile.am
>> +++ b/cpukit/libdl/Makefile.am
>> @@ -30,7 +30,7 @@ libdl_a_SOURCES = \
>>   libdl_a_SOURCES += rtl-mdreloc-@RTEMS_CPU@.c
>>   libdl_a_CPPFLAGS = $(AM_CPPFLAGS) -DRTEMS_RTL_RAP_LOADER=1 
>> -DRTEMS_RTL_ELF_LOADER=1
>>
>> +endif
>> +
>>   include $(srcdir)/preinstall.am
>>   include $(top_srcdir)/automake/local.am
>> -
>> -endif
>>

-- 
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherr...@oarcorp.comOn-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available(256) 722-9985

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 1/7] libdl/Makefile.am: Need preinstall on all targets

2014-11-04 Thread Chris Johns

On 5/11/2014 8:47 am, Joel Sherrill wrote:


On 11/4/2014 3:29 PM, Chris Johns wrote:

Hi Joel,

These look fine.

All of these patches?



Yes.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP

2014-11-04 Thread Joel Sherrill


On November 4, 2014 5:27:51 PM CST, Andre Marques 
 wrote:
>On 11/04/14 23:16, Joel Sherrill wrote:
>> On 11/4/2014 5:01 PM, Andre Marques wrote:
>>> Hi gedare,
>>>
>>> will send a new version of this patch in the next few days.
>>>
>>> Replies to your comments below.
>>>
>> I am too overwhelmed to remember but are there example
>> and/or test programs for the IO pins?
>
>Yes I have put the test cases and the device drivers I used during
>development in github:
>
>https://github.com/asuol/RTEMS_rpi_testing

Gedare.. Any suggestions for a home on git.rtems.org? The best idea I have is a 
subdirectory in examples

>>
>> FWIW I have a Pinewood Derby application that uses 3 discrete
>> inputs to time two wooden cars on a race track. I need to move
>> it to my personal git repo. It was developed to use a parallel
>> port on a PC as input but moving to a Raspberry Pi for it would
>> be cool!
>>
>> --joel
>>> --André Marques.
>>>
>>> On 10/31/14 14:25, Gedare Bloom wrote:
 Thanks, I'll leave detailed comments to the experts but noticed a
>few things.

 On Fri, Oct 31, 2014 at 7:56 AM, Andre Marques
  wrote:
> Aditional documentation can be found in the RTEMS wiki
>
> http://www.rtems.org/wiki/index.php/Raspberry_Pi_BSP_Peripherals
>
> and on my GSOC development blog
>
> http://asuolgsoc2014.wordpress.com/2014/08/18/testing-the-project/
>
> Device drivers and test cases used to test this work were moved to
>a github repository
>
> https://github.com/asuol/RTEMS_rpi_testing
> ---
>c/src/lib/libbsp/arm/raspberrypi/Makefile.am   |  11 +-
>c/src/lib/libbsp/arm/raspberrypi/configure.ac  |  12 +
>c/src/lib/libbsp/arm/raspberrypi/gpio/gpio.c   | 745
>+
>c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c | 427
>
>c/src/lib/libbsp/arm/raspberrypi/i2c/i2c_init.c|  78 +++
>c/src/lib/libbsp/arm/raspberrypi/i2c/spi.c | 564
>
>c/src/lib/libbsp/arm/raspberrypi/i2c/spi_init.c|  83 +++
>c/src/lib/libbsp/arm/raspberrypi/include/gpio.h| 198 ++
>c/src/lib/libbsp/arm/raspberrypi/include/i2c.h | 166 +
>c/src/lib/libbsp/arm/raspberrypi/include/irq.h |   6 +-
>.../libbsp/arm/raspberrypi/include/raspberrypi.h   |  79 ++-
>c/src/lib/libbsp/arm/raspberrypi/irq/irq.c | 103 ++-
>c/src/lib/libbsp/arm/raspberrypi/preinstall.am |   8 +
>.../lib/libbsp/arm/raspberrypi/startup/bspstart.c  |  17 +-
>14 files changed, 2475 insertions(+), 22 deletions(-)
>create mode 100644 c/src/lib/libbsp/arm/raspberrypi/gpio/gpio.c
>create mode 100644 c/src/lib/libbsp/arm/raspberrypi/i2c/i2c.c
>create mode 100644
>c/src/lib/libbsp/arm/raspberrypi/i2c/i2c_init.c
>create mode 100644 c/src/lib/libbsp/arm/raspberrypi/i2c/spi.c
>create mode 100644
>c/src/lib/libbsp/arm/raspberrypi/i2c/spi_init.c
>create mode 100644
>c/src/lib/libbsp/arm/raspberrypi/include/gpio.h
>create mode 100644
>c/src/lib/libbsp/arm/raspberrypi/include/i2c.h
>
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
>b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> index 839c8de..81dc196 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> +++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> @@ -44,6 +44,8 @@ include_bsp_HEADERS += include/irq.h
>include_bsp_HEADERS += include/mmu.h
>include_bsp_HEADERS += include/usart.h
>include_bsp_HEADERS += include/raspberrypi.h
> +include_bsp_HEADERS += include/gpio.h
> +include_bsp_HEADERS += include/i2c.h
>
>include_libcpu_HEADERS =
>../../../libcpu/arm/shared/include/cache_.h \
>../../../libcpu/arm/shared/include/arm-cp15.h
> @@ -79,7 +81,6 @@ libbsp_a_SOURCES += ../../shared/bspclean.c
>libbsp_a_SOURCES += ../../shared/bspgetworkarea.c
>libbsp_a_SOURCES += ../../shared/bsplibc.c
>libbsp_a_SOURCES += ../../shared/bsppost.c
> -libbsp_a_SOURCES += ../../shared/bsppredriverhook.c
>libbsp_a_SOURCES += ../../shared/bsppretaskinghook.c
>libbsp_a_SOURCES += ../../shared/cpucounterread.c
>libbsp_a_SOURCES += ../../shared/cpucounterdiff.c
> @@ -119,11 +120,19 @@ libbsp_a_SOURCES += clock/clockdrv.c
>../../../shared/clockdrv_shell.h
># Timer
>libbsp_a_SOURCES += misc/timer.c
>
> +# GPIO
> +
> +libbsp_a_SOURCES += gpio/gpio.c
> +
># RTC
>
># SSP
>
># I2C
> +libbsp_a_SOURCES += i2c/i2c.c
> +libbsp_a_SOURCES += i2c/i2c_init.c
> +libbsp_a_SOURCES += i2c/spi.c
> +libbsp_a_SOURCES += i2c/spi_init.c
>
># Cache
>libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/configure.ac
>b/c/src/lib/libbsp/arm/raspberrypi/confi

Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP

2014-11-04 Thread Andre Marques

Hello Pavel,

On 10/31/14 15:41, Pavel Pisa wrote:

Hello Andre,

On Friday 31 of October 2014 12:56:40 Andre Marques wrote:


+/**
+ * @brief Generic ISR that clears the event register on the Raspberry Pi
and calls + *an user defined ISR.
+ *
+ * @param[in] arg Void pointer to a handler_arguments structure.
+ */
+static void generic_handler(void* arg)
+{
+  handler_arguments* handler_args;
+  int rv = 0;
+  int pin = 0;
+
+  handler_args = (handler_arguments*) arg;
+
+  pin = handler_args->pin_number;
+
+  /*  If the interrupt was generated by the pin attached to this ISR
clears it. */ +  if ( BCM2835_REG(BCM2835_GPIO_GPEDS0) & (1 << pin) )
+BCM2835_REG(BCM2835_GPIO_GPEDS0) &= (1 << pin);
+
+  /* If not lets the next ISR process the interrupt. */
+  else
+return;
+
+  /* If this pin has the deboucing function attached, call it. */
+  if ( handler_args->debouncing_tick_count > 0 ) {
+rv = debounce_switch(pin);
+
+if ( rv < 0 )
+  return;
+  }
+
+  /* Call the user's ISR. */
+  (handler_args->handler) (handler_args->handler_arg);
+}

There has to be mechanism (array of pointers) for registering args
for each pin handler routine.



Yes currently it does not allow an user to specify an handler routine 
with parameters. Will check that.



+/**
+ * @brief Enables interrupts to be generated on a given GPIO pin.
+ *When fired that interrupt will call the given handler.
+ *
+ * @param[in] dev_pin Raspberry Pi GPIO pin label number (not its position
+ *on the header).
+ * @param[in] interrupt Type of interrupt to enable for the pin.
+ * @param[in] handler Pointer to a function that will be called every time
+ *@var interrupt is generated. This function must have
+ *no receiving parameters and return void.

   @param[in] arg or context


+ *
+ * @retval 0 Interrupt successfully enabled for this pin.
+ * @retval -1 Could not replace the currently active interrupt on this
pin, or + *unknown @var interrupt.
+ */
+int gpio_enable_interrupt(int dev_pin, gpio_interrupt interrupt, void
(*handler)(void)) +{


int gpio_enable_interrupt(int dev_pin, gpio_interrupt interrupt, void
(*handler)(void *arg), void *arg)

It would worth to be able to register mutiple handlers for single
pin for case o emulating shared IRQ line - i.e. ISA bus, then information
about IRQ handled/unhandled state has to be returned by handler - but that
is not critical. Argument is critical as I have already stated.

The handler function prototype should be same as for RTEMS ISR registration

typedef void (*rtems_interrupt_handler)(void *);

This allows to use drivers for some generic chips to be connected
to some external bus same way on different CPU and boards architectures
with same ISR handler when directly connected to some external interrupt
input and use same driver+handler when interrupt is connected
to GPIO ISR multiplexor.

I have already raised this concern for previous patch version
- see mail thread

http://article.gmane.org/gmane.os.rtems.user/13211


+  rtems_status_code sc;
+  rpi_gpio_pin *pin;
+
+  /* Only consider GPIO pins up to 31. */
+  if ( dev_pin > 31 )
+return -1;
+
+  pin = &gpio_pin[dev_pin-1];
+
+  /* If the pin already has an enabled interrupt removes it first,
+   * as well as its handler. */
+  if ( pin->enabled_interrupt != NONE ) {
+sc = gpio_disable_interrupt(dev_pin);
+
+if ( sc != RTEMS_SUCCESSFUL )
+  return -1;
+  }
+
+  pin->h_args.pin_number = dev_pin;
+  pin->h_args.handler = handler;

   +  pin->h_args.handler_arg = arg;



+
+  pin->h_args.last_isr_tick = rtems_clock_get_ticks_since_boot();
+
+  /* Installs the generic_handler, which will call the user handler
received +   * a parameter. */
+  sc = rtems_interrupt_handler_install(BCM2835_IRQ_ID_GPIO_0,
+   NULL,
+   RTEMS_INTERRUPT_SHARED,
+   (rtems_interrupt_handler)
generic_handler, +   &(pin->h_args));

The use of RTEMS_INTERRUPT_SHARED and registering multiple handlers
for single pin group is significant overhead. It would be much faster
to register only one handler (when gpio_enable_interrupt is called first time).
Then read interrupt status register (if before HW masking, apply mask)
and use ffs (find first bit set) in loop to process all pending events.
Each time ffs gives the bit, clear the bit in the local copy,
retrieve pin description from the array (ffs gives the index)
and process user provided handler with corresponding user argument.


+  if ( sc != RTEMS_SUCCESSFUL )
+return -1;
+
+  switch ( interrupt ) {
+case FALLING_EDGE:
+
+  /* Enables asynchronous falling edge detection. */
+  BCM2835_REG(BCM2835_GPIO_GPAFEN0) |= (1 << dev_pin);
+
+  break;
+
+case RISING_EDGE:
+
+  /* Enables asynchronous rising edge detection. */
+  BCM2835_REG(BCM2835_G

Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP

2014-11-04 Thread Gedare Bloom
On Tue, Nov 4, 2014 at 6:01 PM, Andre Marques
 wrote:
> Hi gedare,
>
> will send a new version of this patch in the next few days.
>
> Replies to your comments below.
>
> --André Marques.
>
> On 10/31/14 14:25, Gedare Bloom wrote:
>>
>> Thanks, I'll leave detailed comments to the experts but noticed a few
>> things.
>>
>> On Fri, Oct 31, 2014 at 7:56 AM, Andre Marques
>>  wrote:
>>>
[...]
>>> +return -1;
>>
>> Consider using more informative error codes.
>
>
> Should I print something before the return?
>
No, but you could return something that maps to an rtems_status_code.
I don't have an example off-hand, but the idea is to give a better
clue to users about what went wrong.

[,,,]
>>> +  /* Call the user's ISR. */
>>> +  (handler_args->handler) ();
>>
>> Probably should pass the handler_args to the handler.
>
>
> The handler args are processed in this generic handler, as it avoids calling
> the handler when the interrupt was generated by a switch bounce. The called
> handler (given by an application) receives no arguments.
>
I think Pavel made some comments regarding passing arguments. It is
usually a good idea to provide some way to pass at least the "context"
of an ISR to the handler, so it can make informed decisions about what
to do. This is especially important when one handler de-multiplexes
several interrupt sources.

[...]
>>> +/**
>>> + * @brief Reads/writes to/from the I2C bus.
>>> + *
>>> + * @param[in] bushdl Pointer to the libi2c API bus driver data
>>> structure.
>>> + * @param[in] rd_buf Read buffer. If not NULL the function will read
>>> from
>>> + *   the bus and store the read on this buffer.
>>> + * @param[in] wr_buf Write buffer. If not NULL the function will write
>>> the
>>> + *   contents of this buffer to the bus.
>>> + * @param[in] buffer_size Size of the non-NULL buffer.
>>> + *
>>> + * @retval -1 Could not send/receive data to/from the bus.
>>> + * @retval >=0 The number of bytes read/written.
>>> + */
>>> +static int bcm2835_i2c_read_write(rtems_libi2c_bus_t * bushdl, unsigned
>>> char *rd_buf, const unsigned char *wr_buf, int buffer_size)
>>> +{
>>> +  bcm2835_i2c_softc_t *softc_ptr = &(((bcm2835_i2c_desc_t
>>> *)(bushdl))->softc);
>>> +
>>> +  uint32_t bytes_sent = buffer_size;
>>> +
>>> +  /* Since there is a maximum of 0x packets per transfer
>>> +   * (size of the DLEN register), count how many transfers will be
>>> +   * needed and adjust each transfer size accordingly. */
>>> +  int transfer_count = buffer_size / 0x;
>>> +  uint16_t dlen_buffer_size;
>>> +
>>> +  /* If the buffer size is a multiple of the max size per transfer,
>>> +   * round up the transfer count. */
>>> +  if ( buffer_size % 0x != 0 )
>>> +transfer_count++;
>>> +
>>
>> You can calculate transfer_count more efficiently with
>> transfer_count = (buffer_size + 0xFFFE) / 0x;
>>
>> In general, ceil(x/n) = (x + (n-1))/n
>>
>>> +  do {
>>> +if (transfer_count > 1)
>>> +  dlen_buffer_size = 0x;
>>> +else
>>> +  dlen_buffer_size = (buffer_size & 0x);
>>> +
>>> +/* Set the DLEN register, which specifies how many data packets will
>>> be transferred. */
>>> +BCM2835_REG(BCM2835_I2C_DLEN) = dlen_buffer_size;
>>> +
>>> +/* Clear the acknowledgment and clock stretching error status. */
>>> +BCM2835_REG(BCM2835_I2C_S) |= (3 << 8);
>>> +
>>> +/* While there is data to transfer. */
>>> +while ( dlen_buffer_size >= 1 ) {
>>> +
>>> +  /* If writing. */
>>> +  if ( rd_buf == NULL ) {
>>> +
>>> +/* If transfer is not active, send start bit. */
>>> +if( (BCM2835_REG(BCM2835_I2C_S) & (1 << 0)) == 0)
>>> +  BCM2835_REG(BCM2835_I2C_C) |= (1 << 7);
>>> +
>>> +/* If using the I2C bus in interrupt-driven mode. */
>>> +if ( I2C_IO_MODE == 1 ) {
>>> +
>>> +  /* Generate interrupts on the TXW bit condition. */
>>> +  BCM2835_REG(BCM2835_I2C_C) |= (1 << 9);
>>> +
>>> +  if ( rtems_semaphore_obtain(softc_ptr->irq_sema_id,
>>> RTEMS_WAIT, 50) != RTEMS_SUCCESSFUL )
>>
>> Is the semaphore accounted for in confdefs?
>
>
> I account for it in my test cases but I am not sure if I mentioned this in
> the documentation. Will check that.
>
>>> +return -1;
>>> +}
>>> +
>>> +/* If using the bus in polling mode. */
>>> +else
>>> +  /* Poll TXW bit until there is space available to write. */
>>> +  while ( (BCM2835_REG(BCM2835_I2C_S) & (1 << 2)) == 0 )
>>> +;
>>> +
>>> +/* Write data to the TX FIFO. */
>>> +BCM2835_REG(BCM2835_I2C_FIFO) = (*(uint8_t *)wr_buf);
>>> +
>>> +wr_buf++;
>>> +
>>> +/* Check for acknowledgment or clock stretching errors. */
>>> +if ( (BCM2835_REG(BCM2835_I2C_S) & (1 << 8)) ||
>>> (BCM2835_REG(BCM2835_I2C_S) & (1 << 9)) )
>>> +  return -1;
>>> +  }
>>> +
>>> +  /* If reading. */
>>> +  else {
>>> +/* Send start bit. Be

Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP

2014-11-04 Thread Gedare Bloom
On Tue, Nov 4, 2014 at 6:29 PM, Joel Sherrill  wrote:
>
>
> On November 4, 2014 5:27:51 PM CST, Andre Marques 
>  wrote:
>>On 11/04/14 23:16, Joel Sherrill wrote:
>>> On 11/4/2014 5:01 PM, Andre Marques wrote:
 Hi gedare,

 will send a new version of this patch in the next few days.

 Replies to your comments below.

>>> I am too overwhelmed to remember but are there example
>>> and/or test programs for the IO pins?
>>
>>Yes I have put the test cases and the device drivers I used during
>>development in github:
>>
>>https://github.com/asuol/RTEMS_rpi_testing
>
> Gedare.. Any suggestions for a home on git.rtems.org? The best idea I have is 
> a subdirectory in examples
>
These are ideal for BSP-specific testing framework, which we presently
lack. I'm not certain where they should go. Maybe a repo for
BSP-specific examples is a useful idea.

Gedare
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Add GPIO, I2C and SPI support for the RPi BSP

2014-11-04 Thread Chris Johns

On 5/11/2014 2:40 pm, Gedare Bloom wrote:

These are ideal for BSP-specific testing framework, which we presently
lack. I'm not certain where they should go.


What about examples-v2 ? You could add a boards directory and the code 
under arch/bsp. The waf build system lets you know when a specific 
arch/bsp is being built.



Maybe a repo for BSP-specific examples is a useful idea.


I am attempting to lower the number of repos we have. Every repo needs 
testing.


Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Test failures on arm/realview_pbx_a9_qemu

2014-11-04 Thread Sebastian Huber

Hello,

on the latest Git master the following new tests fail on 
arm/realview_pbx_a9_qemu due to a timeout after 180 seconds: top, dl01.pre and 
dl02.pre.


Attached are the log files.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


*** BEGIN OF TEST TOP ***
 Press ENTER to exit.

uptime:   0.044649
---
  CPU USAGE BY THREAD
+-+---+---+
 ID | NAME| RPRI | CPRI   | SECONDS   | PERCENT
+-+---+---+
 0x0A010001 | UI1 |1 |1   |  0.020957 |  36.531
 0x0A010005 | TA03|1 |1   |  0.015740 |  25.797
 0x0A010002 | TA02|2 |2   |  0.003576 |   5.550
 0x0A010003 | TA01|2 |2   |  0.002941 |   4.340
 0x09010001 | IDLE|  255 |  255   |  0.00 |   0.000
 0x0A010004 | CPlt|2 |2   |  0.031269 |  41.980














 Press ENTER to exit.

uptime:   5.071975
---
  CPU USAGE BY THREAD
+-+---+---+
 ID | NAME| RPRI | CPRI   | SECONDS   | PERCENT
+-+---+---+
 0x09010001 | IDLE|  255 |  255   |  4.666756 |  91.491
 0x0A010002 | TA02|2 |2   |  0.244932 |   4.798
 0x0A010005 | TA03|1 |1   |  0.076957 |   1.506
 0x0A010004 | CPlt|2 |2   |  0.050300 |   0.984
 0x0A010001 | UI1 |1 |1   |  0.020957 |   0.409
 0x0A010006 | TA04|1 |1   |  0.020513 |   0.400
 0x0A010003 | TA01|2 |2   |  0.005811 |   0.113







 Press ENTER to exit.

uptime:  10.122198
---
  CPU USAGE BY THREAD
+-+---+---+
 ID | NAME| RPRI | CPRI   | SECONDS   | PERCENT
+-+---+---+
 0x09010001 | IDLE|  255 |  255   |  9.254421 |  91.309
 0x0A010002 | TA02|2 |2   |  0.482391 |   4.757
 0x0A010005 | TA03|1 |1   |  0.153558 |   1.508
 0x0A010006 | TA04|1 |1   |  0.102426 |   1.005
 0x0A010004 | CPlt|2 |2   |  0.082041 |   0.805
 0x0A010007 | TA05|1 |1   |  0.025394 |   0.249
 0x0A010001 | UI1 |1 |1   |  0.020957 |   0.205
 0x0A010003 | TA01|2 |2   |  0.008698 |   0.085
 Press ENTER to exit.

uptime:  15.192422
---
  CPU USAGE BY THREAD
+-+---+---+
 ID | NAME| RPRI | CPRI   | SECONDS   | PERCENT
+-+---+---+
 0x09010001 | IDLE|  255 |  255   | 13.712299 |  90.180
 0x0A010002 | TA02|2 |2   |  0.714520 |   4.698
 0x0A010005 | TA03|1 |1   |  0.230246 |   1.513
 0x0A010006 | TA04|1 |1   |  0.205035 |   1.347
 0x0A010007 | TA05|1 |1   |  0.151795 |   0.997
 0x0A010004 | CPlt|2 |2   |  0.146233 |   0.960
 0x0A010008 | TA06|1 |1   |  0.030486 |   0.200
 0x0A010001 | UI1 |1 |1   |  0.020957 |   0.137
 0x0A010003 | TA01|2 |2   |  0.011603 |   0.076
 Press ENTER to exit.

uptime:  20.288588
---
  CPU USAGE BY THREAD
+-+---+---+
 ID | NAME| RPRI | CPRI   | SECONDS   | PERCENT
+-+---+---+
 0x09010001 | IDL