Changeset d76a329 in mainline for uspace/app/top/top.c
- Timestamp:
- 2012-04-16T20:08:30Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b1213b0
- Parents:
- f76696f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/top.c
rf76696f rd76a329 371 371 372 372 switch (fa->type) { 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 373 case FIELD_EMPTY: 374 return 0; 375 case FIELD_UINT_SUFFIX_BIN: /* fallthrough */ 376 case FIELD_UINT_SUFFIX_DEC: /* fallthrough */ 377 case FIELD_UINT: 378 if (fa->uint > fb->uint) 379 return 1 * sort_reverse; 380 if (fa->uint < fb->uint) 381 return -1 * sort_reverse; 382 return 0; 383 case FIELD_PERCENT: 384 if (fa->fixed.upper * fb->fixed.lower 385 > fb->fixed.upper * fa->fixed.lower) 386 return 1 * sort_reverse; 387 if (fa->fixed.upper * fb->fixed.lower 388 < fb->fixed.upper * fa->fixed.lower) 389 return -1 * sort_reverse; 390 return 0; 391 case FIELD_STRING: 392 return str_cmp(fa->string, fb->string) * sort_reverse; 393 393 } 394 394 … … 521 521 522 522 switch (op_mode) { 523 524 525 526 527 528 523 case OP_TASKS: 524 return fill_task_table(data); 525 case OP_IPC: 526 return fill_ipc_table(data); 527 case OP_EXCS: 528 return fill_exception_table(data); 529 529 } 530 530 return NULL; … … 627 627 628 628 switch (c) { 629 case -1: /* do nothing */ 629 case -1: /* do nothing */ 630 break; 631 case 't': 632 op_mode = OP_TASKS; 633 break; 634 case 'i': 635 op_mode = OP_IPC; 636 break; 637 case 'e': 638 op_mode = OP_EXCS; 639 break; 640 case 's': 641 screen_mode = SCREEN_SORT; 642 break; 643 case 'r': 644 sort_reverse = -sort_reverse; 645 break; 646 case 'h': 647 case '?': 648 screen_mode = SCREEN_HELP; 649 break; 650 case 'q': 651 goto out; 652 case 'a': 653 if (op_mode == OP_EXCS) { 654 excs_all = !excs_all; 655 if (excs_all) 656 show_warning("Showing all exceptions"); 657 else 658 show_warning("Showing only hot exceptions"); 630 659 break; 631 case 't': 632 op_mode = OP_TASKS; 633 break; 634 case 'i': 635 op_mode = OP_IPC; 636 break; 637 case 'e': 638 op_mode = OP_EXCS; 639 break; 640 case 's': 641 screen_mode = SCREEN_SORT; 642 break; 643 case 'r': 644 sort_reverse = -sort_reverse; 645 break; 646 case 'h': 647 case '?': 648 screen_mode = SCREEN_HELP; 649 break; 650 case 'q': 651 goto out; 652 case 'a': 653 if (op_mode == OP_EXCS) { 654 excs_all = !excs_all; 655 if (excs_all) 656 show_warning("Showing all exceptions"); 657 else 658 show_warning("Showing only hot exceptions"); 659 break; 660 } 661 /* fallthrough */ 662 default: 663 show_warning("Unknown command \"%c\", use \"h\" for help", c); 664 continue; /* don't redraw */ 660 } 661 /* fallthrough */ 662 default: 663 show_warning("Unknown command \"%c\", use \"h\" for help", c); 664 continue; /* don't redraw */ 665 665 } 666 666
Note:
See TracChangeset
for help on using the changeset viewer.