Changeset 7a3ccbc in mainline for uspace/app/top/top.c


Ignore:
Timestamp:
2010-04-07T10:41:42Z (15 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a325832
Parents:
36b5b0f
Message:

Echo task memory in kb instead of pages count

File:
1 edited

Legend:

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

    r36b5b0f r7a3ccbc  
    111111
    112112        /* For all tasks compute sum and differencies of all cycles */
    113         uint64_t pages_total = 0;
     113        uint64_t mem_total = 0;
    114114        uint64_t ucycles_total = 0;
    115115        uint64_t kcycles_total = 0;
     
    131131                kcycles_diff[i] = new_data->taskinfos[i].kcycles - old_data->taskinfos[j].kcycles;
    132132
    133                 pages_total += new_data->taskinfos[i].pages;
     133                mem_total += new_data->taskinfos[i].virt_mem;
    134134                ucycles_total += ucycles_diff[i];
    135135                kcycles_total += kcycles_diff[i];
     
    139139        new_data->task_perc = malloc(new_data->task_count * sizeof(task_perc_t));
    140140        for (i = 0; i < new_data->task_count; ++i) {
    141                 new_data->task_perc[i].pages = (float)(new_data->taskinfos[i].pages * 100) / pages_total;
     141                new_data->task_perc[i].mem = (float)(new_data->taskinfos[i].virt_mem * 100) / mem_total;
    142142                new_data->task_perc[i].ucycles = (float)(ucycles_diff[i] * 100) / ucycles_total;
    143143                new_data->task_perc[i].kcycles = (float)(kcycles_diff[i] * 100) / kcycles_total;
Note: See TracChangeset for help on using the changeset viewer.