Changeset d0c82c5 in mainline for uspace/app/top/top.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/top.c

    r5954241 rd0c82c5  
    175175        }
    176176       
    177         /* For each CPU: Compute total ticks and divide it between
     177        /* For each CPU: Compute total cycles and divide it between
    178178           user and kernel */
    179179       
     
    181181        for (i = 0; i < new_data->cpus_count; i++) {
    182182                uint64_t idle =
    183                     new_data->cpus[i].idle_ticks - old_data->cpus[i].idle_ticks;
     183                    new_data->cpus[i].idle_cycles - old_data->cpus[i].idle_cycles;
    184184                uint64_t busy =
    185                     new_data->cpus[i].busy_ticks - old_data->cpus[i].busy_ticks;
     185                    new_data->cpus[i].busy_cycles - old_data->cpus[i].busy_cycles;
    186186                uint64_t sum = idle + busy;
    187187               
Note: See TracChangeset for help on using the changeset viewer.