Changeset 463de59 in rtems


Ignore:
Timestamp:
Apr 16, 2014, 2:42:37 PM (6 years ago)
Author:
Jennifer Averett <jennifer.averett@…>
Branches:
4.11, master
Children:
82d137ae
Parents:
1af8634
git-author:
Jennifer Averett <jennifer.averett@…> (04/16/14 14:42:37)
git-committer:
Jennifer Averett <jennifer.averett@…> (07/11/14 14:48:50)
Message:

capture: Fix capture engine to handle new extensions.

Location:
cpukit/libmisc/capture
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/capture/capture.c

    r1af8634 r463de59  
    5252                                      RTEMS_CAPTURE_DELETED_EVENT | \
    5353                                      RTEMS_CAPTURE_BEGIN_EVENT | \
    54                                       RTEMS_CAPTURE_EXITTED_EVENT)
     54                                      RTEMS_CAPTURE_EXITTED_EVENT | \
     55                                      RTEMS_CAPTURE_TERMINATED_EVENT)
    5556#else
    5657#define RTEMS_CAPTURE_RECORD_EVENTS  (0)
    5758#endif
     59
     60static bool
     61rtems_capture_create_task (rtems_tcb* current_task,
     62                           rtems_tcb* new_task);
     63
     64static void
     65rtems_capture_start_task (rtems_tcb* current_task,
     66                          rtems_tcb* started_task);
     67
     68static void
     69rtems_capture_restart_task (rtems_tcb* current_task,
     70                            rtems_tcb* restarted_task);
     71
     72static void
     73rtems_capture_delete_task (rtems_tcb* current_task,
     74                           rtems_tcb* deleted_task);
     75
     76static void
     77rtems_capture_switch_task (rtems_tcb* current_task,
     78                           rtems_tcb* heir_task);
     79
     80static void
     81rtems_capture_begin_task (rtems_tcb* begin_task);
     82
     83static void
     84rtems_capture_exitted_task (rtems_tcb* exitted_task);
     85
     86static void
     87rtems_capture_terminated_task (rtems_tcb* terminated_task);
    5888
    5989/*
     
    89119  RTEMS_INTERRUPT_LOCK_INITIALIZER("capture");
    90120
     121static const rtems_extensions_table capture_extensions = {
     122  .thread_create    = rtems_capture_create_task,
     123  .thread_start     = rtems_capture_start_task,
     124  .thread_restart   = rtems_capture_restart_task,
     125  .thread_delete    = rtems_capture_delete_task,
     126  .thread_switch    = rtems_capture_switch_task,
     127  .thread_begin     = rtems_capture_begin_task,
     128  .thread_exitted   = rtems_capture_exitted_task,
     129  .fatal            = NULL,
     130  .thread_terminate = rtems_capture_terminated_task
     131};
     132
    91133/*
    92134 * RTEMS Event text.
     
    102144  "DELETED_BY",
    103145  "DELETED",
     146  "TERMINATED",
    104147  "BEGIN",
    105148  "EXITTED",
     
    788831rtems_capture_terminated_task (rtems_tcb* terminated_task)
    789832{
    790   rtems_capture_delete_task (terminated_task, terminated_task);
    791 }
    792 
    793 /*
    794  * This function is called when a fatal error occurs.
    795  */
    796 static void
    797 rtems_capture_fatal(
    798   Internal_errors_Source source,
    799   bool                   is_internal,
    800   Internal_errors_t      code
    801 )
    802 {
    803 }
    804  
     833  /*
     834   * Get the capture task control block so we can trace this
     835   * event.
     836   */
     837  rtems_capture_task_t* tt;
     838
     839  tt = terminated_task->extensions[capture_extension_index];
     840
     841  /*
     842   * The task pointers may not be known as the task may have
     843   * been created before the capture engine was open. Add them.
     844   */
     845
     846  if (tt == NULL)
     847    tt = rtems_capture_create_capture_task (terminated_task);
     848
     849  if (rtems_capture_trigger (NULL, tt, RTEMS_CAPTURE_TERMINATED))
     850    rtems_capture_record (tt, RTEMS_CAPTURE_TERMINATED_EVENT);
     851
     852  rtems_capture_task_stack_usage (tt);
     853}
     854
    805855/*
    806856 * This function is called when a context is switched.
     
    888938rtems_capture_open (uint32_t   size, rtems_capture_timestamp timestamp __attribute__((unused)))
    889939{
    890   rtems_extensions_table capture_extensions;
    891940  rtems_name             name;
    892941  rtems_status_code      sc;
     
    912961  capture_ceiling = 0;
    913962  capture_floor   = 255;
    914 
    915   /*
    916    * Create the extension table. This is copied so we
    917    * can create it as a local.
    918    */
    919   capture_extensions.thread_create  = rtems_capture_create_task;
    920   capture_extensions.thread_start   = rtems_capture_start_task;
    921   capture_extensions.thread_restart = rtems_capture_restart_task;
    922   capture_extensions.thread_delete  = rtems_capture_delete_task;
    923   capture_extensions.thread_switch  = rtems_capture_switch_task;
    924   capture_extensions.thread_begin   = rtems_capture_begin_task;
    925   capture_extensions.thread_exitted = rtems_capture_exitted_task;
    926   capture_extensions.fatal          = NULL;
    927963
    928964  /*
     
    13421378    case rtems_capture_exitted:
    13431379      return RTEMS_CAPTURE_EXITTED;
     1380    case rtems_capture_terminated:
     1381      return RTEMS_CAPTURE_TERMINATED;
    13441382    default:
    13451383      break;
  • cpukit/libmisc/capture/capture.h

    r1af8634 r463de59  
    121121#define RTEMS_CAPTURE_BEGIN         (1 << 5)
    122122#define RTEMS_CAPTURE_EXITTED       (1 << 6)
     123#define RTEMS_CAPTURE_TERMINATED    (1 << 7)
    123124
    124125#define RTEMS_CAPTURE_FROM_TRIGS    (RTEMS_CAPTURE_SWITCH  | \
     
    209210#define RTEMS_CAPTURE_DELETED_BY_EVENT    UINT32_C (0x00400000)
    210211#define RTEMS_CAPTURE_DELETED_EVENT       UINT32_C (0x00800000)
    211 #define RTEMS_CAPTURE_BEGIN_EVENT         UINT32_C (0x01000000)
    212 #define RTEMS_CAPTURE_EXITTED_EVENT       UINT32_C (0x02000000)
    213 #define RTEMS_CAPTURE_SWITCHED_OUT_EVENT  UINT32_C (0x04000000)
    214 #define RTEMS_CAPTURE_SWITCHED_IN_EVENT   UINT32_C (0x08000000)
    215 #define RTEMS_CAPTURE_TIMESTAMP           UINT32_C (0x10000000)
    216 #define RTEMS_CAPTURE_EVENT_END           (28)
     212#define RTEMS_CAPTURE_TERMINATED_EVENT    UINT32_C (0x01000000)
     213#define RTEMS_CAPTURE_BEGIN_EVENT         UINT32_C (0x02000000)
     214#define RTEMS_CAPTURE_EXITTED_EVENT       UINT32_C (0x04000000)
     215#define RTEMS_CAPTURE_SWITCHED_OUT_EVENT  UINT32_C (0x08000000)
     216#define RTEMS_CAPTURE_SWITCHED_IN_EVENT   UINT32_C (0x10000000)
     217#define RTEMS_CAPTURE_TIMESTAMP           UINT32_C (0x20000000)
     218#define RTEMS_CAPTURE_EVENT_END           (29)
    217219
    218220/**
     
    241243  rtems_capture_delete,
    242244  rtems_capture_begin,
    243   rtems_capture_exitted
     245  rtems_capture_exitted,
     246  rtems_capture_terminated
    244247} rtems_capture_trigger_t;
    245248
Note: See TracChangeset for help on using the changeset viewer.