Changeset 8eec3c8 in mainline for uspace/app/top/screen.c


Ignore:
Timestamp:
2010-06-10T14:24:50Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c0f13d2
Parents:
1113c9e
Message:

merge basic exception accounting (this is the last piece missing from the original "measure" branch by Stanislav Kozina)

File:
1 edited

Legend:

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

    r1113c9e r8eec3c8  
    325325}
    326326
     327static inline void print_exc_head(void)
     328{
     329        screen_style_inverted();
     330        printf("  ID                     Desc    Count   Cycles");
     331        screen_newline();
     332        screen_style_normal();
     333}
     334
     335static inline void print_exc(data_t *data)
     336{
     337        ipcarg_t cols;
     338        ipcarg_t rows;
     339        screen_get_size(&cols, &rows);
     340       
     341        ipcarg_t col;
     342        ipcarg_t row;
     343        screen_get_pos(&col, &row);
     344       
     345        size_t i;
     346        for (i = 0; (i < data->exceptions_count) && (row < rows); i++, row++) {
     347                uint64_t cycles;
     348                char suffix;
     349               
     350                order_suffix(data->exceptions[i].cycles, &cycles, &suffix);
     351                printf("%8u %20s %8" PRIu64 " %8" PRIu64 "%c",
     352                     data->exceptions[i].id, data->exceptions[i].desc,
     353                     data->exceptions[i].count, cycles, suffix);
     354               
     355                screen_newline();
     356        }
     357       
     358        while (row < rows) {
     359                screen_newline();
     360                row++;
     361        }
     362}
     363
    327364void print_data(data_t *data)
    328365{
     
    338375        screen_newline();
    339376       
    340         if (operation_type == OP_IPC) {
     377        switch (operation_type) {
     378        case OP_TASKS:
     379                print_task_head();
     380                print_tasks(data);
     381                break;
     382        case OP_IPC:
    341383                print_ipc_head();
    342384                print_ipc(data);
    343         } else {
    344                 print_task_head();
    345                 print_tasks(data);
     385                break;
     386        case OP_EXC:
     387                print_exc_head();
     388                print_exc(data);
     389                break;
    346390        }
    347391       
Note: See TracChangeset for help on using the changeset viewer.