Changeset bdfd3c97 in mainline
- Timestamp:
- 2010-04-14T15:40:52Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 95319bd
- Parents:
- a307beb
- Location:
- uspace/app/top
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/screen.c
ra307beb rbdfd3c97 204 204 } 205 205 206 static inline void print_ head(void)206 static inline void print_task_head(void) 207 207 { 208 208 fflush(stdout); … … 214 214 fflush(stdout); 215 215 console_set_rgb_color(fphone(stdout), BLACK, WHITE); 216 } 217 218 static inline void print_ipc_head(void) 219 { 220 fflush(stdout); 221 console_set_rgb_color(fphone(stdout), WHITE, BLACK); 222 printf(" ID Calls sent Calls recv Answs sent Answs recv IRQn recv Forw Name"); 223 int i; 224 for (i = 80; i < colls; ++i) 225 puts(" "); 226 fflush(stdout); 227 console_set_rgb_color(fphone(stdout), BLACK, WHITE); 228 } 229 230 static inline void print_ipc(data_t *data, int row) 231 { 232 int i; 233 for (i = 0; i < (int)data->task_count; ++i) { 234 if (row + i > rows) 235 return; 236 task_info_t *taskinfo = &data->taskinfos[i]; 237 task_ipc_info_t *ipcinfo = &taskinfo->ipc_info; 238 printf("%8llu ", taskinfo->taskid); 239 printf("%10llu %10llu %10llu %10llu %10llu %10llu ", 240 ipcinfo->call_sent, ipcinfo->call_recieved, 241 ipcinfo->answer_sent, ipcinfo->answer_recieved, 242 ipcinfo->irq_notif_recieved, ipcinfo->forwarded); 243 printf("%s\n", taskinfo->name); 244 } 216 245 } 217 246 … … 238 267 puts("\n"); 239 268 ++up_rows; 240 print_head(); 241 puts("\n"); 242 print_tasks(data, up_rows); 269 if (operation_type == OP_IPC) { 270 print_ipc_head(); 271 puts("\n"); 272 print_ipc(data, up_rows); 273 } else { 274 print_task_head(); 275 puts("\n"); 276 print_tasks(data, up_rows); 277 } 243 278 fflush(stdout); 244 279 } -
uspace/app/top/top.c
ra307beb rbdfd3c97 56 56 #define MINUTE 60 57 57 58 int number = 0;59 int number2 = 0; 58 int operation_type; 59 60 60 static void read_data(data_t *target) 61 61 { … … 188 188 189 189 /* And paint screen until death... */ 190 operation_type = OP_TASKS; 190 191 while (true) { 191 192 char c = tgetchar(UPDATE_INTERVAL); … … 202 203 clear_screen(); 203 204 return 0; 205 case 'i': 206 PRINT_WARNING("Showing IPC statistics", c); 207 operation_type = OP_IPC; 208 break; 209 case 't': 210 PRINT_WARNING("Showing task stats", c); 211 operation_type = OP_TASKS; 212 break; 204 213 default: 205 214 PRINT_WARNING("Unknown command: %c", c); -
uspace/app/top/top.h
ra307beb rbdfd3c97 42 42 (float).lower = (b); \ 43 43 } 44 45 #define OP_TASKS 1 46 #define OP_IPC 2 47 extern int operation_type; 44 48 45 49 typedef struct {
Note:
See TracChangeset
for help on using the changeset viewer.