Changeset 1c18ebf in rtems


Ignore:
Timestamp:
Aug 31, 2016, 8:56:09 AM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
7af6b58c
Parents:
6da06c5
git-author:
Chris Johns <chrisj@…> (08/31/16 08:56:09)
git-committer:
Chris Johns <chrisj@…> (09/01/16 01:11:45)
Message:

libmisc/capture: Remove the reserved _t in the types.

Files:
11 edited

Legend:

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

    r6da06c5 r1c18ebf  
    112112    return;
    113113
    114   sc = rtems_capture_control (enable);
     114  sc = rtems_capture_set_control (enable);
    115115
    116116  if (sc != RTEMS_SUCCESSFUL)
     
    162162  rtems_status_code sc;
    163163
    164   sc = rtems_capture_control (true);
     164  sc = rtems_capture_set_control (true);
    165165
    166166  if (sc != RTEMS_SUCCESSFUL)
     
    187187  rtems_status_code sc;
    188188
    189   sc = rtems_capture_control (false);
     189  sc = rtems_capture_set_control (false);
    190190
    191191  if (sc != RTEMS_SUCCESSFUL)
     
    271271                             bool                               verbose RC_UNUSED)
    272272{
    273   rtems_capture_time_t uptime;
    274 
    275   rtems_capture_time (&uptime);
     273  rtems_capture_time uptime;
     274
     275  rtems_capture_get_time (&uptime);
    276276
    277277  rtems_capture_cli_task_count = 0;
     
    711711 * Structure to handle the parsing of the trigger command line.
    712712 */
    713 typedef struct rtems_capture_cli_triggers_s
    714 {
    715   char const *            name;
    716   rtems_capture_trigger_t type;
    717   int                     to_only;
    718 } rtems_capture_cli_triggers_t;
    719 
    720 static rtems_capture_cli_triggers_t rtems_capture_cli_triggers[] =
     713typedef struct rtems_capture_cli_triggers
     714{
     715  char const *          name;
     716  rtems_capture_trigger type;
     717  int                   to_only;
     718} rtems_capture_cli_triggers;
     719
     720static const rtems_capture_cli_triggers rtems_capture_cli_trigger[] =
    721721{
    722722  { "switch",  rtems_capture_switch,  0 }, /* must be first */
     
    729729};
    730730
    731 typedef enum rtems_capture_cli_trig_state_e
     731typedef enum rtems_capture_cli_trig_state
    732732{
    733733  trig_type,
     
    735735  trig_from_from,
    736736  trig_from
    737 } rtems_capture_cli_trig_state_t;
     737} rtems_capture_cli_trig_state;
    738738
    739739#define RTEMS_CAPTURE_CLI_TRIGGERS_NUM \
    740   (sizeof (rtems_capture_cli_triggers) / sizeof (rtems_capture_cli_triggers_t))
     740  (sizeof (rtems_capture_cli_trigger) / sizeof (rtems_capture_cli_triggers))
    741741
    742742static void
    743743rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
    744744{
    745   rtems_status_code            sc;
    746   int                          arg;
    747   int                          trigger = 0; /* switch */
    748   rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any;
    749   bool                         trigger_set = false;
    750   bool                         is_from = false;
    751   bool                         is_to = false;
    752   rtems_name                   name = 0;
    753   rtems_id                     id = 0;
    754   bool                         valid_name = false;
    755   bool                         valid_id = false;
    756   rtems_name                   from_name = 0;
    757   rtems_id                     from_id = 0;
    758   bool                         from_valid_name = false;
    759   bool                         from_valid_id = false;
    760   rtems_name                   to_name = 0;
    761   rtems_id                     to_id = 0;
    762   bool                         to_valid_name = false;
    763   bool                         to_valid_id = false;
     745  rtems_status_code          sc;
     746  int                        arg;
     747  int                        trigger = 0; /* switch */
     748  rtems_capture_trigger_mode trigger_mode = rtems_capture_from_any;
     749  bool                       trigger_set = false;
     750  bool                       is_from = false;
     751  bool                       is_to = false;
     752  rtems_name                 name = 0;
     753  rtems_id                   id = 0;
     754  bool                       valid_name = false;
     755  bool                       valid_id = false;
     756  rtems_name                 from_name = 0;
     757  rtems_id                   from_id = 0;
     758  bool                       from_valid_name = false;
     759  bool                       from_valid_id = false;
     760  rtems_name                 to_name = 0;
     761  rtems_id                   to_id = 0;
     762  bool                       to_valid_name = false;
     763  bool                       to_valid_id = false;
    764764
    765765  for (arg = 1; arg < argc; arg++)
     
    786786
    787787        for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
    788           if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0)
     788          if (strcmp (argv[arg], rtems_capture_cli_trigger[t].name) == 0)
    789789          {
    790790            trigger = t;
     
    875875  }
    876876
    877   if (is_from && rtems_capture_cli_triggers[trigger].to_only)
     877  if (is_from && rtems_capture_cli_trigger[trigger].to_only)
    878878  {
    879879    fprintf (stdout, "error: a %s trigger can be a TO trigger\n",
    880              rtems_capture_cli_triggers[trigger].name);
     880             rtems_capture_cli_trigger[trigger].name);
    881881    return;
    882882  }
     
    891891  {
    892892    fprintf (stdout, "error: a %s trigger needs a TO name or id\n",
    893              rtems_capture_cli_triggers[trigger].name);
     893             rtems_capture_cli_trigger[trigger].name);
    894894    return;
    895895  }
     
    898898  {
    899899    fprintf (stdout, "error: a %s trigger needs a FROM name or id\n",
    900              rtems_capture_cli_triggers[trigger].name);
     900             rtems_capture_cli_trigger[trigger].name);
    901901    return;
    902902  }
     
    912912    sc = rtems_capture_set_trigger (from_name, from_id, to_name, to_id,
    913913                                    trigger_mode,
    914                                     rtems_capture_cli_triggers[trigger].type);
     914                                    rtems_capture_cli_trigger[trigger].type);
    915915  else
    916916    sc = rtems_capture_clear_trigger (from_name, from_id, to_name, to_id,
    917917                                      trigger_mode,
    918                                       rtems_capture_cli_triggers[trigger].type);
     918                                      rtems_capture_cli_trigger[trigger].type);
    919919
    920920  if (sc != RTEMS_SUCCESSFUL)
     
    11931193       cmd < sizeof (rtems_capture_cli_cmds) / sizeof (rtems_monitor_command_entry_t);
    11941194       cmd++)
    1195       rtems_monitor_insert_cmd (&rtems_capture_cli_cmds[cmd]);
     1195    rtems_monitor_insert_cmd (&rtems_capture_cli_cmds[cmd]);
    11961196
    11971197  return RTEMS_SUCCESSFUL;
  • cpukit/libmisc/capture/capture.c

    r6da06c5 r1c18ebf  
    5757
    5858typedef struct {
    59   rtems_capture_buffer_t  records;
    60   uint32_t                 count;
    61   rtems_id                 reader;
    62   rtems_interrupt_lock     lock;
    63   uint32_t                 flags;
     59  rtems_capture_buffer records;
     60  uint32_t             count;
     61  rtems_id             reader;
     62  rtems_interrupt_lock lock;
     63  uint32_t             flags;
    6464} rtems_capture_per_cpu_data;
    6565
    6666typedef struct {
    67   uint32_t                 flags;
    68   rtems_capture_control_t* controls;
    69   int                      extension_index;
    70   rtems_capture_timestamp  timestamp;
    71   rtems_task_priority      ceiling;
    72   rtems_task_priority      floor;
    73   rtems_interrupt_lock     lock;
     67  uint32_t                flags;
     68  rtems_capture_control* controls;
     69  int                     extension_index;
     70  rtems_capture_timestamp timestamp;
     71  rtems_task_priority     ceiling;
     72  rtems_task_priority     floor;
     73  rtems_interrupt_lock    lock;
    7474} rtems_capture_global_data;
    7575
     
    146146 */
    147147void
    148 rtems_capture_get_time (rtems_capture_time_t* time)
     148rtems_capture_get_time (rtems_capture_time* time)
    149149{
    150150  if (capture_timestamp)
     
    222222 */
    223223static inline bool
    224 rtems_capture_by_in_to (uint32_t                 events,
    225                         rtems_tcb*               by,
    226                         rtems_capture_control_t* to)
     224rtems_capture_by_in_to (uint32_t               events,
     225                        rtems_tcb*             by,
     226                        rtems_capture_control* to)
    227227{
    228228  uint32_t valid_mask = RTEMS_CAPTURE_CONTROL_FROM_MASK (0);
     
    266266 * This function searches for a trigger given a name.
    267267 */
    268 static inline rtems_capture_control_t*
     268static inline rtems_capture_control*
    269269rtems_capture_find_control (rtems_name name, rtems_id id)
    270270{
    271   rtems_capture_control_t* control;
     271  rtems_capture_control* control;
    272272  for (control = capture_controls; control != NULL; control = control->next)
    273273    if (rtems_capture_match_name_id (name, id, control->name, control->id))
     
    285285  if (tcb->Capture.control == NULL)
    286286  {
    287     rtems_name               name = rtems_build_name(0, 0, 0, 0);
    288     rtems_id                 id;
    289     rtems_capture_control_t* control;
     287    rtems_name             name = rtems_build_name(0, 0, 0, 0);
     288    rtems_id               id;
     289    rtems_capture_control* control;
    290290
    291291    /*
     
    308308}
    309309
    310 static rtems_capture_control_t*
     310static rtems_capture_control*
    311311rtems_capture_create_control (rtems_name name, rtems_id id)
    312312{
    313313  rtems_interrupt_lock_context lock_context;
    314   rtems_capture_control_t*     control;
     314  rtems_capture_control     control;
    315315
    316316  if ((name == 0) && (id == 0))
     
    376376  uint8_t*                    ptr;
    377377
    378   size += sizeof (rtems_capture_record_t);
     378  size += sizeof (rtems_capture_record);
    379379
    380380  cpu = capture_per_cpu_get (rtems_get_current_processor ());
     
    385385  if (ptr != NULL)
    386386  {
    387     rtems_capture_record_t in;
     387    rtems_capture_record in;
    388388
    389389    ++cpu->count;
     
    420420rtems_capture_initialize_task( rtems_tcb* tcb )
    421421{
    422   rtems_capture_control_t*     control;
     422  rtems_capture_control     control;
    423423  rtems_name                   name = rtems_build_name(0, 0, 0, 0);
    424424  rtems_id                     id = rtems_capture_task_id (tcb);
     
    450450  rtems_name                        name = rtems_build_name (0, 0, 0, 0);
    451451  rtems_id                          id = rtems_capture_task_id (tcb);
    452   rtems_capture_task_record_t       rec;
     452  rtems_capture_task_record         rec;
    453453  void*                             ptr;
    454454  rtems_interrupt_lock_context      lock_context;
     
    487487       RTEMS_CAPTURE_TRIGGERED))
    488488  {
    489     rtems_capture_control_t* control;
     489    rtems_capture_control* control;
    490490
    491491    control = tcb->Capture.control;
     
    514514 */
    515515bool
    516 rtems_capture_trigger (rtems_tcb* ft, rtems_tcb* tt, uint32_t events)
     516rtems_capture_trigger_fired (rtems_tcb* ft, rtems_tcb* tt, uint32_t events)
    517517{
    518518  /*
     
    521521  if (!(capture_flags_global & RTEMS_CAPTURE_TRIGGERED))
    522522  {
    523     rtems_capture_control_t* fc = NULL;
    524     rtems_capture_control_t* tc = NULL;
    525     uint32_t                 from_events = 0;
    526     uint32_t                 to_events = 0;
    527     uint32_t                 from_to_events = 0;
     523    rtems_capture_control* fc = NULL;
     524    rtems_capture_control* tc = NULL;
     525    uint32_t               from_events = 0;
     526    uint32_t               to_events = 0;
     527    uint32_t               from_to_events = 0;
    528528
    529529    if (ft)
     
    583583rtems_capture_open (uint32_t   size, rtems_capture_timestamp timestamp RTEMS_UNUSED)
    584584{
    585   rtems_status_code       sc = RTEMS_SUCCESSFUL;
    586   size_t                  count;
    587   uint32_t                i;
    588   rtems_capture_buffer_t* buff;
     585  rtems_status_code     sc = RTEMS_SUCCESSFUL;
     586  size_t                count;
     587  uint32_t              i;
     588  rtems_capture_buffer* buff;
    589589
    590590  /*
     
    640640{
    641641  rtems_interrupt_lock_context lock_context;
    642   rtems_capture_control_t*     control;
     642  rtems_capture_control     control;
    643643  rtems_status_code            sc;
    644644  uint32_t                     cpu;
     
    677677  while (control)
    678678  {
    679     rtems_capture_control_t* delete = control;
     679    rtems_capture_control* delete = control;
    680680    control = control->next;
    681681    free (delete);
     
    697697
    698698rtems_status_code
    699 rtems_capture_control (bool enable)
     699rtems_capture_set_control (bool enable)
    700700{
    701701  rtems_interrupt_lock_context lock_context;
     
    725725 */
    726726rtems_status_code
    727 rtems_capture_monitor (bool enable)
     727rtems_capture_set_monitor (bool enable)
    728728{
    729729  rtems_interrupt_lock_context lock_context;
     
    812812rtems_capture_watch_add (rtems_name name, rtems_id id)
    813813{
    814   rtems_capture_control_t* control;
     814  rtems_capture_control* control;
    815815
    816816  if ( (capture_flags_global & RTEMS_CAPTURE_ON) != 0 )
     
    844844{
    845845  rtems_interrupt_lock_context lock_context;
    846   rtems_capture_control_t*     control;
    847   rtems_capture_control_t**    prev_control;
     846  rtems_capture_control     control;
     847  rtems_capture_control**      prev_control;
    848848  bool                         found = false;
    849849
     
    893893{
    894894  rtems_interrupt_lock_context lock_context;
    895   rtems_capture_control_t*     control;
     895  rtems_capture_control     control;
    896896  bool                         found = false;
    897897
     
    10091009 */
    10101010static uint32_t
    1011 rtems_capture_map_trigger (rtems_capture_trigger_t trigger)
     1011rtems_capture_map_trigger (rtems_capture_trigger trigger)
    10121012{
    10131013  /*
     
    10501050 */
    10511051rtems_status_code
    1052 rtems_capture_set_trigger (rtems_name                   from_name,
    1053                            rtems_id                     from_id,
    1054                            rtems_name                   to_name,
    1055                            rtems_id                     to_id,
    1056                            rtems_capture_trigger_mode_t mode,
    1057                            rtems_capture_trigger_t      trigger)
    1058 {
    1059   rtems_capture_control_t* control;
    1060   uint32_t                 flags;
     1052rtems_capture_set_trigger (rtems_name                 from_name,
     1053                           rtems_id                   from_id,
     1054                           rtems_name                 to_name,
     1055                           rtems_id                   to_id,
     1056                           rtems_capture_trigger_mode mode,
     1057                           rtems_capture_trigger      trigger)
     1058{
     1059  rtems_capture_control* control;
     1060  uint32_t               flags;
    10611061
    10621062  flags = rtems_capture_map_trigger (trigger);
     
    11281128 */
    11291129rtems_status_code
    1130 rtems_capture_clear_trigger (rtems_name                   from_name,
    1131                              rtems_id                     from_id,
    1132                              rtems_name                   to_name,
    1133                              rtems_id                     to_id,
    1134                              rtems_capture_trigger_mode_t mode,
    1135                              rtems_capture_trigger_t      trigger)
    1136 {
    1137   rtems_capture_control_t* control;
    1138   uint32_t                 flags;
     1130rtems_capture_clear_trigger (rtems_name                 from_name,
     1131                             rtems_id                   from_id,
     1132                             rtems_name                 to_name,
     1133                             rtems_id                   to_id,
     1134                             rtems_capture_trigger_mode mode,
     1135                             rtems_capture_trigger      trigger)
     1136{
     1137  rtems_capture_control* control;
     1138  uint32_t               flags;
    11391139
    11401140  flags = rtems_capture_map_trigger (trigger);
     
    12031203  while (bytes < size)
    12041204  {
    1205     const rtems_capture_record_t* rec = (const rtems_capture_record_t*) ptr;
     1205    const rtems_capture_record* rec = (const rtems_capture_record*) ptr;
    12061206    recs++;
    12071207    ptr += rec->size;
     
    12351235    rtems_interrupt_lock_context lock_context;
    12361236    size_t                       recs_size = 0;
    1237     rtems_capture_buffer_t*      records;
     1237    rtems_capture_buffer      records;
    12381238    uint32_t*                    flags;
    12391239
     
    12881288    rtems_interrupt_lock_context lock_context;
    12891289    uint8_t*                     ptr;
    1290     rtems_capture_record_t*      rec;
     1290    rtems_capture_record      rec;
    12911291    uint32_t                     counted;
    12921292    size_t                       ptr_size = 0;
    12931293    size_t                       rel_size = 0;
    12941294    RTEMS_INTERRUPT_LOCK_REFERENCE( lock, &(capture_lock_on_cpu( cpu )) )
    1295     rtems_capture_buffer_t*      records = &(capture_records_on_cpu( cpu ));
     1295    rtems_capture_buffer      records = &(capture_records_on_cpu( cpu ));
    12961296    uint32_t*                    flags = &(capture_flags_on_cpu( cpu ));
    12971297    uint32_t*                    total = &(capture_count_on_cpu( cpu ));
     
    13171317    rel_size = 0;
    13181318    while (counted--) {
    1319       rec = (rtems_capture_record_t*) ptr;
     1319      rec = (rtems_capture_record*) ptr;
    13201320      rel_size += rec->size;
    13211321      _Assert( rel_size <= ptr_size );
     
    13431343
    13441344/*
    1345  * This function returns the current time. If a handler is provided
    1346  * by the user get the time from that.
    1347  */
    1348 void
    1349 rtems_capture_time (rtems_capture_time_t* uptime)
    1350 {
    1351   rtems_capture_get_time(uptime);
    1352 }
    1353 
    1354 /*
    13551345 * This function returns a string for an event based on the bit in the
    13561346 * event. The functions takes the bit offset as a number not the bit
     
    13691359 * capture engine.
    13701360 */
    1371 rtems_capture_control_t*
     1361rtems_capture_control*
    13721362rtems_capture_get_control_list (void)
    13731363{
  • cpukit/libmisc/capture/capture.h

    r6da06c5 r1c18ebf  
    7676 * This is a nanosecond capture timestamp
    7777 */
    78 typedef uint64_t rtems_capture_time_t;
     78typedef uint64_t rtems_capture_time;
    7979
    8080/**
     
    8787 * structure has the specific *_BY bit set.
    8888 */
    89 typedef struct rtems_capture_from_s
     89typedef struct rtems_capture_from
    9090{
    9191  rtems_name name;
    9292  rtems_id   id;
    9393  uint32_t   trigger;
    94 } rtems_capture_from_t;
     94} rtems_capture_from;
    9595
    9696/**
     
    105105 * in by are valid.
    106106 */
    107 typedef struct rtems_capture_control_s
    108 {
    109   rtems_name                      name;
    110   rtems_id                        id;
    111   uint32_t                        flags;
    112   uint32_t                        to_triggers;
    113   uint32_t                        from_triggers;
    114   uint32_t                        by_triggers;
    115   uint32_t                        by_valid;
    116   rtems_capture_from_t            by[RTEMS_CAPTURE_TRIGGER_TASKS];
    117   struct rtems_capture_control_s* next;
    118 } rtems_capture_control_t;
     107typedef struct rtems_capture_control
     108{
     109  rtems_name                    name;
     110  rtems_id                      id;
     111  uint32_t                      flags;
     112  uint32_t                      to_triggers;
     113  uint32_t                      from_triggers;
     114  uint32_t                      by_triggers;
     115  uint32_t                      by_valid;
     116  rtems_capture_from            by[RTEMS_CAPTURE_TRIGGER_TASKS];
     117  struct rtems_capture_control* next;
     118} rtems_capture_control;
    119119
    120120/**
     
    169169 * at the time of the context switch.
    170170 */
    171 typedef struct rtems_capture_record_s
    172 {
    173   size_t                size;
    174   uint32_t              events;
    175   rtems_capture_time_t time;
    176   rtems_id              task_id;
    177 } RTEMS_PACKED rtems_capture_record_t;
     171typedef struct rtems_capture_record
     172{
     173  size_t             size;
     174  uint32_t           events;
     175  rtems_capture_time time;
     176  rtems_id           task_id;
     177} RTEMS_PACKED rtems_capture_record;
    178178
    179179/*
     
    184184 * at the time of the context switch.
    185185 */
    186 typedef struct rtems_capture_task_record_s
     186typedef struct rtems_capture_task_record
    187187{
    188188  rtems_name          name;
    189189  rtems_task_priority start_priority;
    190190  uint32_t            stack_size;
    191 } RTEMS_PACKED rtems_capture_task_record_t;
     191} RTEMS_PACKED rtems_capture_task_record;
    192192
    193193/**
     
    220220 * The types of trigger modes that exist.
    221221 */
    222 typedef enum rtems_capture_trigger_mode_e
     222typedef enum rtems_capture_trigger_mode
    223223{
    224224  rtems_capture_to_any,
    225225  rtems_capture_from_any,
    226226  rtems_capture_from_to
    227 } rtems_capture_trigger_mode_t;
     227} rtems_capture_trigger_mode;
    228228
    229229/**
     
    232232 * The types of triggers that exist.
    233233 */
    234 typedef enum rtems_capture_trigger_e
     234typedef enum rtems_capture_trigger
    235235{
    236236  rtems_capture_switch,
     
    242242  rtems_capture_exitted,
    243243  rtems_capture_terminated
    244 } rtems_capture_trigger_t;
     244} rtems_capture_trigger;
    245245
    246246/**
     
    252252 */
    253253
    254 typedef void (*rtems_capture_timestamp)(rtems_capture_time_t* time);
     254typedef void (*rtems_capture_timestamp)(rtems_capture_time* time);
    255255
    256256/**
     
    314314 *         source of the error.
    315315 */
    316 rtems_status_code rtems_capture_control (bool enable);
     316rtems_status_code rtems_capture_set_control (bool enable);
    317317
    318318/**
     
    329329 *         source of the error.
    330330 */
    331 rtems_status_code rtems_capture_monitor (bool enable);
     331rtems_status_code rtems_capture_set_monitor (bool enable);
    332332
    333333/*
     
    504504 */
    505505rtems_status_code
    506 rtems_capture_set_trigger (rtems_name                   from_name,
    507                            rtems_id                     from_id,
    508                            rtems_name                   to_name,
    509                            rtems_id                     to_id,
    510                            rtems_capture_trigger_mode_t mode,
    511                            rtems_capture_trigger_t      trigger);
     506rtems_capture_set_trigger (rtems_name                 from_name,
     507                           rtems_id                   from_id,
     508                           rtems_name                 to_name,
     509                           rtems_id                   to_id,
     510                           rtems_capture_trigger_mode mode,
     511                           rtems_capture_trigger      trigger);
    512512
    513513/**
     
    530530 */
    531531rtems_status_code
    532 rtems_capture_clear_trigger (rtems_name                   from_name,
    533                              rtems_id                     from_id,
    534                              rtems_name                   to_name,
    535                              rtems_id                     to_id,
    536                              rtems_capture_trigger_mode_t mode,
    537                              rtems_capture_trigger_t      trigger);
     532rtems_capture_clear_trigger (rtems_name                 from_name,
     533                             rtems_id                   from_id,
     534                             rtems_name                 to_name,
     535                             rtems_id                   to_id,
     536                             rtems_capture_trigger_mode mode,
     537                             rtems_capture_trigger      trigger);
    538538
    539539/**
     
    579579rtems_status_code rtems_capture_release (uint32_t cpu, uint32_t count);
    580580
    581 /*
    582  * @brief Capture nano-second time period.
    583  *
    584  * This function returns the time period in nano-seconds.
    585  *
    586  * @param[out] uptime The nano-second time period.
    587  */
    588 void rtems_capture_time (rtems_capture_time_t* uptime);
    589 
    590581/**
    591582 * @brief Capture filter
     
    613604 * is provided.  Otherwise, it returns a resolution defined by the handler.
    614605 */
    615 void rtems_capture_get_time (rtems_capture_time_t* time);
     606void rtems_capture_get_time (rtems_capture_time* time);
    616607
    617608/**
     
    635626 * @param[in] tcb is the task control block for the task
    636627 */
    637 void rtems_capture_initialize_task( rtems_tcb* tcb );
     628void rtems_capture_initialize_task (rtems_tcb* tcb);
    638629
    639630/**
     
    644635 * @param[in] tcb is the task control block for the task
    645636 */
    646 void rtems_capture_record_task( rtems_tcb* tcb );
     637void rtems_capture_record_task (rtems_tcb* tcb);
    647638
    648639/**
     
    740731 * @param[in] tcb is the task control block for the task
    741732 */
    742 static inline bool rtems_capture_task_recorded( rtems_tcb* tcb ) {
    743   return ( (tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0 );
     733static inline bool rtems_capture_task_recorded (rtems_tcb* tcb) {
     734  return ((tcb->Capture.flags & RTEMS_CAPTURE_RECORD_TASK) != 0);
    744735}
    745736
     
    752743 * @param[in] tcb is the task control block for the task
    753744 */
    754 static inline bool rtems_capture_task_initialized( rtems_tcb* tcb ) {
    755   return ( (tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0 );
     745static inline bool rtems_capture_task_initialized (rtems_tcb* tcb) {
     746  return ((tcb->Capture.flags & RTEMS_CAPTURE_INIT_TASK) != 0);
    756747}
    757748
     
    844835 * @retval This function returns the task control if present.
    845836 */
    846 static inline rtems_capture_control_t*
     837static inline rtems_capture_control*
    847838rtems_capture_task_control (rtems_tcb* tcb)
    848839{
     
    862853rtems_capture_task_control_flags (rtems_tcb* tcb)
    863854{
    864   rtems_capture_control_t*  control = tcb->Capture.control;
     855  rtems_capture_control*  control = tcb->Capture.control;
    865856  if (!control)
    866857    return 0;
     
    925916 * capture engine.
    926917 */
    927 rtems_capture_control_t*
     918rtems_capture_control*
    928919rtems_capture_get_control_list (void);
    929920
     
    939930 * pointer NULL terminates the list.
    940931 */
    941 static inline rtems_capture_control_t*
    942 rtems_capture_next_control (rtems_capture_control_t* control)
     932static inline rtems_capture_control*
     933rtems_capture_next_control (rtems_capture_control* control)
    943934{
    944935  return control->next;
     
    955946 */
    956947static inline rtems_id
    957 rtems_capture_control_id (rtems_capture_control_t* control)
     948rtems_capture_control_id (rtems_capture_control* control)
    958949{
    959950  return control->id;
     
    970961 */
    971962static inline rtems_name
    972 rtems_capture_control_name (rtems_capture_control_t* control)
     963rtems_capture_control_name (rtems_capture_control* control)
    973964{
    974965  return control->name;
     
    985976 */
    986977static inline uint32_t
    987 rtems_capture_control_flags (rtems_capture_control_t* control)
     978rtems_capture_control_flags (rtems_capture_control* control)
    988979{
    989980  return control->flags;
     
    1000991 */
    1001992static inline uint32_t
    1002 rtems_capture_control_to_triggers (rtems_capture_control_t* control)
     993rtems_capture_control_to_triggers (rtems_capture_control* control)
    1003994{
    1004995  return control->to_triggers;
     
    10151006 */
    10161007static inline uint32_t
    1017 rtems_capture_control_from_triggers (rtems_capture_control_t* control)
     1008rtems_capture_control_from_triggers (rtems_capture_control* control)
    10181009{
    10191010  return control->from_triggers;
     
    10301021 */
    10311022static inline uint32_t
    1032 rtems_capture_control_all_by_triggers (rtems_capture_control_t* control)
     1023rtems_capture_control_all_by_triggers (rtems_capture_control* control)
    10331024{
    10341025  return control->by_triggers;
     
    10461037 */
    10471038static inline int
    1048 rtems_capture_control_by_valid (rtems_capture_control_t* control, int slot)
     1039rtems_capture_control_by_valid (rtems_capture_control* control, int slot)
    10491040{
    10501041  return control->by_valid & RTEMS_CAPTURE_CONTROL_FROM_MASK (slot);
     
    10621053 */
    10631054static inline rtems_name
    1064 rtems_capture_control_by_name (rtems_capture_control_t* control, int by)
     1055rtems_capture_control_by_name (rtems_capture_control* control, int by)
    10651056{
    10661057  if (by < RTEMS_CAPTURE_TRIGGER_TASKS)
     
    10771068 */
    10781069static inline rtems_id
    1079 rtems_capture_control_by_id (rtems_capture_control_t* control, int by)
     1070rtems_capture_control_by_id (rtems_capture_control* control, int by)
    10801071{
    10811072  if (by < RTEMS_CAPTURE_TRIGGER_TASKS)
     
    10921083 */
    10931084static inline uint32_t
    1094 rtems_capture_control_by_triggers (rtems_capture_control_t* control,
     1085rtems_capture_control_by_triggers (rtems_capture_control* control,
    10951086                                   int                      by)
    10961087{
     
    11121103rtems_capture_control_count (void)
    11131104{
    1114   rtems_capture_control_t* control = rtems_capture_get_control_list ();
    1115   uint32_t                 count = 0;
     1105  rtems_capture_control* control = rtems_capture_get_control_list ();
     1106  uint32_t               count = 0;
    11161107
    11171108  while (control)
  • cpukit/libmisc/capture/capture_buffer.c

    r6da06c5 r1c18ebf  
    2828
    2929void*
    30 rtems_capture_buffer_allocate (rtems_capture_buffer_t* buffer, size_t size)
     30rtems_capture_buffer_allocate (rtems_capture_buffer* buffer, size_t size)
    3131{
    3232  void* ptr = NULL;
     
    9696
    9797void*
    98 rtems_capture_buffer_free (rtems_capture_buffer_t* buffer, size_t size)
     98rtems_capture_buffer_free (rtems_capture_buffer* buffer, size_t size)
    9999{
    100   void   *ptr;
    101   size_t  next;
    102   size_t  buff_size;
     100  voidptr;
     101  size_t next;
     102  size_t buff_size;
    103103
    104104  if (size == 0)
  • cpukit/libmisc/capture/capture_buffer.h

    r6da06c5 r1c18ebf  
    3737 * Capture buffer. There is one per CPU.
    3838 */
    39 typedef struct {
     39typedef struct rtems_capture_buffer {
    4040  uint8_t* buffer;       /**< The per cpu buffer. */
    4141  size_t   size;         /**< The size of the buffer in bytes. */
     
    4545  size_t   end;          /**< Buffer current end, it may move in. */
    4646  size_t   max_rec;      /**< The largest record in the buffer. */
    47 } rtems_capture_buffer_t;
     47} rtems_capture_buffer;
    4848
    4949static inline void
    50 rtems_capture_buffer_flush (rtems_capture_buffer_t* buffer)
     50rtems_capture_buffer_flush (rtems_capture_buffer* buffer)
    5151{
    5252  buffer->end = buffer->size;
     
    5757
    5858static inline void
    59 rtems_capture_buffer_create (rtems_capture_buffer_t* buffer, size_t size)
     59rtems_capture_buffer_create (rtems_capture_buffer* buffer, size_t size)
    6060{
    6161  buffer->buffer = malloc(size);
     
    6565
    6666static inline void
    67 rtems_capture_buffer_destroy (rtems_capture_buffer_t*  buffer)
     67rtems_capture_buffer_destroy (rtems_capture_buffer*  buffer)
    6868{
    6969  rtems_capture_buffer_flush (buffer);
     
    7373
    7474static inline bool
    75 rtems_capture_buffer_is_empty (rtems_capture_buffer_t* buffer)
     75rtems_capture_buffer_is_empty (rtems_capture_buffer* buffer)
    7676{
    7777   return buffer->count == 0;
     
    7979
    8080static inline bool
    81 rtems_capture_buffer_is_full (rtems_capture_buffer_t* buffer)
     81rtems_capture_buffer_is_full (rtems_capture_buffer* buffer)
    8282{
    8383   return buffer->count == buffer->size;
     
    8585
    8686static inline bool
    87 rtems_capture_buffer_has_wrapped (rtems_capture_buffer_t* buffer)
     87rtems_capture_buffer_has_wrapped (rtems_capture_buffer* buffer)
    8888{
    8989  if (buffer->tail > buffer->head)
     
    9494
    9595static inline void*
    96 rtems_capture_buffer_peek (rtems_capture_buffer_t* buffer, size_t* size)
     96rtems_capture_buffer_peek (rtems_capture_buffer* buffer, size_t* size)
    9797{
    9898  if (rtems_capture_buffer_is_empty (buffer))
     
    110110}
    111111
    112 void* rtems_capture_buffer_allocate (rtems_capture_buffer_t* buffer, size_t size);
     112void* rtems_capture_buffer_allocate (rtems_capture_buffer* buffer, size_t size);
    113113
    114 void* rtems_capture_buffer_free (rtems_capture_buffer_t* buffer, size_t size);
     114void* rtems_capture_buffer_free (rtems_capture_buffer* buffer, size_t size);
    115115
    116116#ifdef __cplusplus
  • cpukit/libmisc/capture/capture_support.c

    r6da06c5 r1c18ebf  
    4242typedef struct
    4343{
    44   const void*            recs;      /**< Next record to be read. */
    45   size_t                 read;      /**< Number of records read. */
    46   size_t                 printed;   /**< Records been printed. */
    47   bool                   rec_valid; /**< The record is valid. */
    48   rtems_capture_record_t rec;       /**< The record, copied out. */
    49 } ctrace_per_cpu_t;
     44  const void*          recs;      /**< Next record to be read. */
     45  size_t               read;      /**< Number of records read. */
     46  size_t               printed;   /**< Records been printed. */
     47  bool                 rec_valid; /**< The record is valid. */
     48  rtems_capture_record rec;       /**< The record, copied out. */
     49} ctrace_per_cpu;
    5050
    5151/*
     
    187187
    188188void
    189 rtems_capture_print_record_task (int                                cpu,
    190                                  const rtems_capture_record_t*      rec,
    191                                  const rtems_capture_task_record_t* task_rec)
     189rtems_capture_print_record_task (int                              cpu,
     190                                 const rtems_capture_record*      rec,
     191                                 const rtems_capture_task_record* task_rec)
    192192{
    193193  fprintf(stdout,"%2i ", cpu);
     
    216216
    217217void
    218 rtems_capture_print_record_capture(int                           cpu,
    219                                    const rtems_capture_record_t* rec,
    220                                    uint64_t                      diff,
    221                                    const rtems_name*             name)
     218rtems_capture_print_record_capture(int                         cpu,
     219                                   const rtems_capture_record* rec,
     220                                   uint64_t                    diff,
     221                                   const rtems_name*           name)
    222222{
    223223  uint32_t event;
     
    263263rtems_capture_print_trace_records (int total, bool csv)
    264264{
    265   ctrace_per_cpu_t*    per_cpu;
    266   ctrace_per_cpu_t*    cpu;
    267   int                  cpus;
    268   rtems_capture_time_t last_time = 0;
    269   int                  i;
     265  ctrace_per_cpu*    per_cpu;
     266  ctrace_per_cpu*    cpu;
     267  int                cpus;
     268  rtems_capture_time last_time = 0;
     269  int                i;
    270270
    271271  cpus = rtems_get_processor_count ();
     
    280280  while (total)
    281281  {
    282     const rtems_capture_record_t* rec_out = NULL;
    283     int                           cpu_out = -1;
    284     rtems_capture_time_t          this_time = 0;
     282    const rtems_capture_record* rec_out = NULL;
     283    int                         cpu_out = -1;
     284    rtems_capture_time          this_time = 0;
    285285
    286286    /* Prime the per_cpu data */
     
    346346      if ((rec_out->events >> RTEMS_CAPTURE_EVENT_START) == 0)
    347347      {
    348         rtems_capture_task_record_t task_rec;
     348        rtems_capture_task_record task_rec;
    349349        cpu->recs = rtems_capture_record_extract (cpu->recs,
    350350                                                  &task_rec,
     
    355355      else
    356356      {
    357         rtems_capture_time_t diff;
    358         const rtems_name*    name = NULL;
     357        rtems_capture_time diff;
     358        const rtems_name*  name = NULL;
    359359        if (last_time != 0)
    360360          diff = rec_out->time - last_time;
     
    403403rtems_capture_print_watch_list (void)
    404404{
    405   rtems_capture_control_t* control = rtems_capture_get_control_list ();
    406   rtems_task_priority      ceiling = rtems_capture_watch_get_ceiling ();
    407   rtems_task_priority      floor = rtems_capture_watch_get_floor ();
     405  rtems_capture_control* control = rtems_capture_get_control_list ();
     406  rtems_task_priority    ceiling = rtems_capture_watch_get_ceiling ();
     407  rtems_task_priority    floor = rtems_capture_watch_get_floor ();
    408408
    409409  fprintf (stdout, "watch priority ceiling is %" PRId32 "\n", ceiling);
  • cpukit/libmisc/capture/capture_user_extension.c

    r6da06c5 r1c18ebf  
    7979};
    8080
    81 static inline void rtems_capture_record (rtems_tcb* tcb, uint32_t events)
     81static inline void capture_record (rtems_tcb* tcb, uint32_t events)
    8282{
    8383  rtems_capture_record_lock_context rec_context;
     
    141141  rtems_capture_initialize_task (nt);
    142142
    143   if (rtems_capture_trigger (ct, nt, RTEMS_CAPTURE_CREATE))
    144   {
    145     rtems_capture_record (ct, RTEMS_CAPTURE_CREATED_BY_EVENT);
    146     rtems_capture_record (nt, RTEMS_CAPTURE_CREATED_EVENT);
     143  if (rtems_capture_trigger_fired (ct, nt, RTEMS_CAPTURE_CREATE))
     144  {
     145    capture_record (ct, RTEMS_CAPTURE_CREATED_BY_EVENT);
     146    capture_record (nt, RTEMS_CAPTURE_CREATED_EVENT);
    147147  }
    148148
     
    168168    rtems_capture_initialize_task (st);
    169169
    170   if (rtems_capture_trigger (ct, st, RTEMS_CAPTURE_START))
    171   {
    172     rtems_capture_record (ct, RTEMS_CAPTURE_STARTED_BY_EVENT);
    173     rtems_capture_record (st, RTEMS_CAPTURE_STARTED_EVENT);
     170  if (rtems_capture_trigger_fired (ct, st, RTEMS_CAPTURE_START))
     171  {
     172    capture_record (ct, RTEMS_CAPTURE_STARTED_BY_EVENT);
     173    capture_record (st, RTEMS_CAPTURE_STARTED_EVENT);
    174174  }
    175175}
     
    192192    rtems_capture_initialize_task (rt);
    193193
    194   if (rtems_capture_trigger (ct, rt, RTEMS_CAPTURE_RESTART))
    195   {
    196     rtems_capture_record (ct, RTEMS_CAPTURE_RESTARTED_BY_EVENT);
    197     rtems_capture_record (rt, RTEMS_CAPTURE_RESTARTED_EVENT);
     194  if (rtems_capture_trigger_fired (ct, rt, RTEMS_CAPTURE_RESTART))
     195  {
     196    capture_record (ct, RTEMS_CAPTURE_RESTARTED_BY_EVENT);
     197    capture_record (rt, RTEMS_CAPTURE_RESTARTED_EVENT);
    198198  }
    199199}
     
    212212    rtems_capture_initialize_task (dt);
    213213
    214   if (rtems_capture_trigger (ct, dt, RTEMS_CAPTURE_DELETE))
    215   {
    216     rtems_capture_record (ct, RTEMS_CAPTURE_DELETED_BY_EVENT);
    217     rtems_capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT);
     214  if (rtems_capture_trigger_fired (ct, dt, RTEMS_CAPTURE_DELETE))
     215  {
     216    capture_record (ct, RTEMS_CAPTURE_DELETED_BY_EVENT);
     217    capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT);
    218218  }
    219219}
     
    233233    rtems_capture_initialize_task (bt);
    234234
    235   if (rtems_capture_trigger (NULL, bt, RTEMS_CAPTURE_BEGIN))
    236     rtems_capture_record (bt, RTEMS_CAPTURE_BEGIN_EVENT);
     235  if (rtems_capture_trigger_fired (NULL, bt, RTEMS_CAPTURE_BEGIN))
     236    capture_record (bt, RTEMS_CAPTURE_BEGIN_EVENT);
    237237}
    238238
     
    252252    rtems_capture_initialize_task (et);
    253253
    254   if (rtems_capture_trigger (NULL, et, RTEMS_CAPTURE_EXITTED))
    255     rtems_capture_record (et, RTEMS_CAPTURE_EXITTED_EVENT);
     254  if (rtems_capture_trigger_fired (NULL, et, RTEMS_CAPTURE_EXITTED))
     255    capture_record (et, RTEMS_CAPTURE_EXITTED_EVENT);
    256256}
    257257
     
    270270    rtems_capture_initialize_task (tt);
    271271
    272   if (rtems_capture_trigger (NULL, tt, RTEMS_CAPTURE_TERMINATED))
    273     rtems_capture_record (tt, RTEMS_CAPTURE_TERMINATED_EVENT);
     272  if (rtems_capture_trigger_fired (NULL, tt, RTEMS_CAPTURE_TERMINATED))
     273    capture_record (tt, RTEMS_CAPTURE_TERMINATED_EVENT);
    274274}
    275275
     
    289289  if (flags & RTEMS_CAPTURE_ON)
    290290  {
    291     rtems_capture_time_t time;
     291    rtems_capture_time time;
    292292    if (!rtems_capture_task_initialized (ct))
    293293      rtems_capture_initialize_task (ct);
     
    302302    rtems_capture_get_time (&time);
    303303
    304     if (rtems_capture_trigger (ct, ht, RTEMS_CAPTURE_SWITCH))
     304    if (rtems_capture_trigger_fired (ct, ht, RTEMS_CAPTURE_SWITCH))
    305305    {
    306       rtems_capture_record (ct, RTEMS_CAPTURE_SWITCHED_OUT_EVENT);
    307       rtems_capture_record (ht, RTEMS_CAPTURE_SWITCHED_IN_EVENT);
     306      capture_record (ct, RTEMS_CAPTURE_SWITCHED_OUT_EVENT);
     307      capture_record (ht, RTEMS_CAPTURE_SWITCHED_IN_EVENT);
    308308    }
    309309  }
  • cpukit/libmisc/capture/captureimpl.h

    r6da06c5 r1c18ebf  
    103103
    104104/**
    105  * @brief Capture trigger.
     105 * @brief Capture check trigger.
    106106 *
    107107 * This function checks if we have triggered or if this event is a
     
    115115 * if the event is a cause of a trigger.
    116116 */
    117 bool rtems_capture_trigger (rtems_tcb* ft,
    118                             rtems_tcb* tt,
    119                             uint32_t   events);
     117bool rtems_capture_trigger_fired (rtems_tcb* ft,
     118                                  rtems_tcb* tt,
     119                                  uint32_t   events);
    120120
    121121/**
     
    150150 * @param[in] rec specifies the task record.
    151151 */
    152 void rtems_capture_print_record_task(int                                cpu,
    153                                      const rtems_capture_record_t*      rec,
    154                                      const rtems_capture_task_record_t* task_rec);
     152void rtems_capture_print_record_task(int                              cpu,
     153                                     const rtems_capture_record*      rec,
     154                                     const rtems_capture_task_record* task_rec);
    155155
    156156/**
     
    166166 * @param[in] task_count number of tasks to search for.
    167167 */
    168 void rtems_capture_print_record_capture(int                           cpu,
    169                                         const rtems_capture_record_t* rec,
    170                                         uint64_t                      diff,
    171                                         const rtems_name*             name);
     168void rtems_capture_print_record_capture(int                         cpu,
     169                                        const rtems_capture_record* rec,
     170                                        uint64_t                    diff,
     171                                        const rtems_name*           name);
    172172
    173173/**
  • testsuites/libtests/capture01/init.c

    r6da06c5 r1c18ebf  
    7979  rtems_capture_print_watch_list();
    8080
    81   sc = rtems_capture_control (true);
     81  sc = rtems_capture_set_control (true);
    8282  ASSERT_SC(sc);
    8383
    8484  capture_test_1();
    8585
    86   sc = rtems_capture_control (false);
     86  sc = rtems_capture_set_control (false);
    8787  ASSERT_SC(sc);
    8888
  • testsuites/smptests/smpcapture01/init.c

    r6da06c5 r1c18ebf  
    233233  }
    234234
    235   sc = rtems_capture_control (true);
     235  sc = rtems_capture_set_control (true);
    236236  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    237237
    238238  test();
    239239
    240   sc = rtems_capture_control (false);
     240  sc = rtems_capture_set_control (false);
    241241  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    242242
  • testsuites/smptests/smpcapture02/init.c

    r6da06c5 r1c18ebf  
    3939  rtems_id task_sem;
    4040  rtems_id prev_sem;
    41 } task_data_t;
     41} per_cpu_task_data;
    4242
    4343typedef struct {
     
    5050
    5151static rtems_id finished_sem;
    52 static task_data_t task_data[ TASKS_PER_CPU * TASKS_PER_CPU ];
     52static per_cpu_task_data task_data[ TASKS_PER_CPU * TASKS_PER_CPU ];
    5353static rtems_interrupt_handler org_clock_handler;
    5454
     
    6666  uint32_t a;
    6767  uint32_t b;
    68 } RTEMS_PACKED enter_add_number_record_t;
     68} RTEMS_PACKED enter_add_number_record;
    6969
    7070typedef struct {
    7171  uint32_t res;
    72 } RTEMS_PACKED exit_add_number_record_t;
     72} RTEMS_PACKED exit_add_number_record;
    7373
    7474typedef struct {
    7575  void *arg;
    76 } RTEMS_PACKED clock_tick_record_t;
     76} RTEMS_PACKED clock_tick_record;
    7777
    7878/*
     
    9898{
    9999  rtems_capture_record_lock_context lock;
    100   enter_add_number_record_t enter_rec;
    101   exit_add_number_record_t exit_rec;
     100  enter_add_number_record enter_rec;
     101  exit_add_number_record exit_rec;
    102102  cap_rec_type id;
    103103  uint32_t res;
     
    289289  const void *recs;
    290290  cap_rec_type id;
    291   rtems_capture_record_t rec;
    292   rtems_capture_record_t prev_rec;
    293   enter_add_number_record_t enter_rec;
    294   exit_add_number_record_t exit_rec;
     291  rtems_capture_record rec;
     292  rtems_capture_record prev_rec;
     293  enter_add_number_record enter_rec;
     294  exit_add_number_record exit_rec;
    295295  clock_interrupt_handler cih = {.found = 0};
    296296
     
    310310  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    311311
    312   sc = rtems_capture_control(true);
     312  sc = rtems_capture_set_control(true);
    313313  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    314314
     
    338338
    339339  /* Disable capturing */
    340   sc = rtems_capture_control(false);
     340  sc = rtems_capture_set_control(false);
    341341  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    342342
Note: See TracChangeset for help on using the changeset viewer.