Changeset ae359a9d in rtems


Ignore:
Timestamp:
Jun 14, 2017, 1:12:57 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b361cb6c
Parents:
369372c3
git-author:
Sebastian Huber <sebastian.huber@…> (06/14/17 13:12:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/16/17 04:13:50)
Message:

shell: Display scheduler instead of current CPU

Display the scheduler name instead of the current CPU in the "task"
shell command. The current CPU could be misleading in case locking
protocols are involved. The "cpuuse" command can be used to obtain the
current CPU.

Location:
cpukit/libmisc/monitor
Files:
2 edited

Legend:

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

    r369372c3 rae359a9d  
    7777    Thread_Control    *rtems_thread;
    7878    RTEMS_API_Control *api;
     79    Objects_Name       name;
    7980
    8081    rtems_thread =
     
    9697    );
    9798
     99    name.name_u32 = _Thread_Scheduler_get_home( rtems_thread )->name;
     100    _Objects_Name_to_string(
     101      name,
     102      false,
     103      canonical_task->scheduler_name,
     104      sizeof( canonical_task->scheduler_name )
     105    );
     106
    98107    rtems_monitor_task_wait_info( canonical_task, rtems_thread );
    99108
     
    102111    canonical_task->stack = rtems_thread->Start.Initial_stack.area;
    103112    canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
    104     canonical_task->cpu = _Per_CPU_Get_index( _Thread_Get_CPU( rtems_thread ) );
    105113    canonical_task->priority = _Thread_Get_priority( rtems_thread );
    106114    canonical_task->events = api->Event.pending_events;
     
    128136{
    129137    fprintf(stdout,"\
    130 ID       NAME                 CPU PRI STATE  MODES    EVENTS WAITINFO\n"); /*
    131 0a010004 SHLL                   0 100 READY  P:T:nA   NONE   00000000 */
     138ID       NAME                 SHED PRI STATE  MODES    EVENTS WAITINFO\n"); /*
     1390a010004 SHLL                 UPD 100 READY  P:T:nA   NONE   00000000 */
    132140
    133141    rtems_monitor_separator();
     
    160168
    161169    length += rtems_monitor_pad(30, length);
    162     length += fprintf(stdout, "%3" PRId32, monitor_task->cpu);
    163     length += rtems_monitor_pad(34, length);
     170    length += fprintf(stdout, "%s", monitor_task->scheduler_name);
     171    length += rtems_monitor_pad(35, length);
    164172    length += rtems_monitor_dump_priority(monitor_task->priority);
    165     length += rtems_monitor_pad(38, length);
     173    length += rtems_monitor_pad(39, length);
    166174    length += rtems_monitor_dump_state(monitor_task->state);
    167     length += rtems_monitor_pad(45, length);
     175    length += rtems_monitor_pad(46, length);
    168176    length += rtems_monitor_dump_modes(monitor_task->modes);
    169     length += rtems_monitor_pad(52, length);
     177    length += rtems_monitor_pad(53, length);
    170178    length += rtems_monitor_dump_events(monitor_task->events);
    171     length += rtems_monitor_pad(61, length);
     179    length += rtems_monitor_pad(62, length);
    172180    length += fprintf(stdout, "%s", monitor_task->wait);
    173181
  • cpukit/libmisc/monitor/monitor.h

    r369372c3 rae359a9d  
    101101    void                      *stack;
    102102    uint32_t                   stack_size;
    103     uint32_t                   cpu;
     103    char                       scheduler_name[5];
    104104    rtems_task_priority        priority;
    105105    States_Control             state;
     
    107107    rtems_mode                 modes;
    108108    rtems_attribute            attributes;
    109     char                       wait[18];
     109    char                       wait[17];
    110110    uint32_t                   ticks;
    111111} rtems_monitor_task_t;
Note: See TracChangeset for help on using the changeset viewer.