Ticket #3552: cpuusagetop.patch
File cpuusagetop.patch, 1.8 KB (added by zhengxiaojun, on 10/17/18 at 05:38:48) |
---|
-
rtems/cpukit/libmisc/cpuuse/cpuusagetop.c
old new 41 41 #include <rtems/score/watchdogimpl.h> 42 42 #include <rtems/score/wkspace.h> 43 43 44 #include <rtems/rtems/tasksimpl.h> 45 #include <rtems/scheduler.h> 46 44 47 #include "cpuuseimpl.h" 45 48 46 49 /* … … 199 202 data->idle = usage; 200 203 data->current_idle = current; 201 204 } 205 if (thread->Object.id == 0x09010002) 206 { 207 data->idle += usage; 208 data->current_idle += current; 209 } 202 210 203 211 /* 204 212 * Create the tasks to display soring as we create. … … 424 432 Thread_Control* thread = data->tasks[i]; 425 433 Timestamp_Control usage; 426 434 Timestamp_Control current_usage; 435 const Scheduler_Control *scheduler; 427 436 428 437 if (thread == NULL) 429 438 break; … … 444 453 if (name[0] == '\0') 445 454 snprintf(name, sizeof(name) - 1, "(%p)", thread->Start.Entry.Kinds.Numeric.entry); 446 455 456 scheduler = _Thread_Scheduler_get_home( thread ); 457 447 458 rtems_printf(data->printer, 448 " 0x%08" PRIx32 " | %-19s | %3" PRId 64 " | %3" PRId64" | ",459 " 0x%08" PRIx32 " | %-19s | %3" PRId32 " | %3" PRId32 " | ", 449 460 thread->Object.id, 450 name, 451 thread->Real_priority.priority,452 _ Thread_Get_priority(thread));461 name, 462 _RTEMS_Priority_From_core(scheduler, thread->Real_priority.priority), 463 _RTEMS_Priority_From_core(scheduler, _Thread_Get_priority(thread))); 453 464 454 465 usage = data->usage[i]; 455 466 current_usage = data->current_usage[i];