Changeset bdfd3c97 in mainline for uspace/app/top/screen.c


Ignore:
Timestamp:
2010-04-14T15:40:52Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
95319bd
Parents:
a307beb
Message:

Press 'i' in top and you can see IPC statistics.

File:
1 edited

Legend:

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

    ra307beb rbdfd3c97  
    204204}
    205205
    206 static inline void print_head(void)
     206static inline void print_task_head(void)
    207207{
    208208        fflush(stdout);
     
    214214        fflush(stdout);
    215215        console_set_rgb_color(fphone(stdout), BLACK, WHITE);
     216}
     217
     218static 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
     230static 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        }
    216245}
    217246
     
    238267        puts("\n");
    239268        ++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        }
    243278        fflush(stdout);
    244279}
Note: See TracChangeset for help on using the changeset viewer.