Changeset 0910e9d4 in rtems


Ignore:
Timestamp:
Jul 22, 2015, 7:05:52 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d70f530
Parents:
1f199799
git-author:
Sebastian Huber <sebastian.huber@…> (07/22/15 07:05:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/24/15 07:09:18)
Message:

monitor: Print the wait queue to ease debugging

Location:
cpukit/libmisc/monitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/monitor/mon-task.c

    r1f199799 r0910e9d4  
    99#include <rtems.h>
    1010#include <rtems/monitor.h>
     11#include <rtems/score/threadqimpl.h>
    1112
    1213#include <stdio.h>
     
    3132    canonical_task->state = rtems_thread->current_state;
    3233    canonical_task->wait_id = rtems_thread->Wait.id;
     34    canonical_task->wait_queue = rtems_thread->Wait.queue;
     35    canonical_task->wait_operations = rtems_thread->Wait.operations;
    3336    canonical_task->events = api->Event.pending_events;
    3437    /*
     
    4649    canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
    4750    canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
    48 
    49 /* XXX more to fix */
    50 /*
    51     (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
    52 */
    5351}
    5452
     
    6058{
    6159    fprintf(stdout,"\
    62   ID       NAME           PRI  STATE MODES   EVENTS    WAITID  WAITARG\n\
    63 ");
    64 /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
    65 0         1         2         3         4         5         6         7       */
     60ID         NAME           PRI STATE  MODES    EVENTS WAITID   WAITQUEUE\n"); /*
     610a010004   SHLL           100 READY  P:T:nA     NONE 00000000 00000000 [DFLT] */
    6662
    6763    rtems_monitor_separator();
     
    8480    length += rtems_monitor_pad(26, length);
    8581    length += rtems_monitor_dump_priority(monitor_task->priority);
    86     length += rtems_monitor_pad(29, length);
     82    length += rtems_monitor_pad(30, length);
    8783    length += rtems_monitor_dump_state(monitor_task->state);
    8884    length += rtems_monitor_pad(37, length);
    8985    length += rtems_monitor_dump_modes(monitor_task->modes);
    90     length += rtems_monitor_pad(45, length);
     86    length += rtems_monitor_pad(44, length);
    9187    length += rtems_monitor_dump_events(monitor_task->events);
    92     if (monitor_task->wait_id)
    93     {
    94         length += rtems_monitor_pad(54, length);
    95         length += rtems_monitor_dump_id(monitor_task->wait_id);
    96         length += rtems_monitor_pad(63, length);
    97         length += rtems_monitor_dump_hex(monitor_task->wait_args);
     88    length += rtems_monitor_pad(53, length);
     89    length += rtems_monitor_dump_id(monitor_task->wait_id);
     90    length += rtems_monitor_pad(62, length);
     91    length += rtems_monitor_dump_addr(monitor_task->wait_queue);
     92    if (monitor_task->wait_operations == &_Thread_queue_Operations_default) {
     93        length += fprintf(stdout, " [DFLT]");
     94    } else if (monitor_task->wait_operations == &_Thread_queue_Operations_FIFO) {
     95        length += fprintf(stdout, " [FIFO]");
     96    } else if (monitor_task->wait_operations == &_Thread_queue_Operations_priority) {
     97        length += fprintf(stdout, " [PRIO]");
     98    } else {
     99        length += fprintf(stdout, " [?]");
    98100    }
    99101
  • cpukit/libmisc/monitor/monitor.h

    r1f199799 r0910e9d4  
    106106    rtems_attribute            attributes;
    107107    rtems_id                   wait_id;
    108     uint32_t                   wait_args;
     108    const void                *wait_queue;
     109    const void                *wait_operations;
    109110    uint32_t                   ticks;
    110111} rtems_monitor_task_t;
Note: See TracChangeset for help on using the changeset viewer.