Changeset b3b7e14 in mainline for uspace/app/top/top.c


Ignore:
Timestamp:
2010-06-11T15:31:03Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
214ec25c
Parents:
be06914
Message:

distinguish between "hot" and "cold" exceptions
display only "hot" exceptions by default
add top to help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/top.c

    rbe06914 rb3b7e14  
    5656#define MINUTE  60
    5757
    58 int operation_type;
     58op_mode_t op_mode = OP_TASKS;
     59bool excs_all = false;
    5960
    6061static const char *read_data(data_t *target)
     
    338339       
    339340        /* And paint screen until death */
    340         operation_type = OP_TASKS;
    341341        while (true) {
    342342                int c = tgetchar(UPDATE_INTERVAL);
     
    360360               
    361361                switch (c) {
     362                        case 't':
     363                                print_warning("Showing task statistics");
     364                                op_mode = OP_TASKS;
     365                                break;
     366                        case 'i':
     367                                print_warning("Showing IPC statistics");
     368                                op_mode = OP_IPC;
     369                                break;
     370                        case 'e':
     371                                print_warning("Showing exception statistics");
     372                                op_mode = OP_EXCS;
     373                                break;
     374                        case 'h':
     375                                print_warning("Showing help");
     376                                op_mode = OP_HELP;
     377                                break;
    362378                        case 'q':
    363379                                goto out;
    364                         case 'i':
    365                                 print_warning("Showing IPC statistics");
    366                                 operation_type = OP_IPC;
    367                                 break;
    368                         case 't':
    369                                 print_warning("Showing task statistics");
    370                                 operation_type = OP_TASKS;
    371                                 break;
    372                         case 'e':
    373                                 print_warning("Showing exception statistics");
    374                                 operation_type = OP_EXC;
    375                                 break;
     380                        case 'a':
     381                                if (op_mode == OP_EXCS) {
     382                                        excs_all = !excs_all;
     383                                        if (excs_all)
     384                                                print_warning("Showing all exceptions");
     385                                        else
     386                                                print_warning("Showing only hot exceptions");
     387                                        break;
     388                                }
    376389                        default:
    377                                 print_warning("Unknown command: %c", c);
     390                                print_warning("Unknown command \"%c\", use \"h\" for help", c);
    378391                                break;
    379392                }
Note: See TracChangeset for help on using the changeset viewer.