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


Ignore:
Timestamp:
2010-06-16T19:44:53Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5387807
Parents:
5954241
Message:

perfect CPU cycles accounting, cherry-picked and adopted from lp:~ersin/helenos/measure2

File:
1 edited

Legend:

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

    r5954241 rd0c82c5  
    222222        for (i = 0; i < data->cpus_count; i++) {
    223223                if (data->cpus[i].active) {
    224                         printf("cpu%u (%4" PRIu16 " MHz): busy ticks: "
    225                             "%" PRIu64 ", idle ticks: %" PRIu64,
     224                        uint64_t busy;
     225                        uint64_t idle;
     226                        char busy_suffix;
     227                        char idle_suffix;
     228                       
     229                        order_suffix(data->cpus[i].busy_cycles, &busy, &busy_suffix);
     230                        order_suffix(data->cpus[i].idle_cycles, &idle, &idle_suffix);
     231                       
     232                        printf("cpu%u (%4" PRIu16 " MHz): busy cycles: "
     233                            "%" PRIu64 "%c, idle cycles: %" PRIu64 "%c",
    226234                            data->cpus[i].id, data->cpus[i].frequency_mhz,
    227                             data->cpus[i].busy_ticks, data->cpus[i].idle_ticks);
     235                            busy, busy_suffix, idle, idle_suffix);
    228236                        puts(", idle: ");
    229237                        print_percent(data->cpus_perc[i].idle, 2);
Note: See TracChangeset for help on using the changeset viewer.