Changeset 7a3ccbc in mainline for uspace/app/top/top.c
- Timestamp:
- 2010-04-07T10:41:42Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a325832
- Parents:
- 36b5b0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/top.c
r36b5b0f r7a3ccbc 111 111 112 112 /* For all tasks compute sum and differencies of all cycles */ 113 uint64_t pages_total = 0;113 uint64_t mem_total = 0; 114 114 uint64_t ucycles_total = 0; 115 115 uint64_t kcycles_total = 0; … … 131 131 kcycles_diff[i] = new_data->taskinfos[i].kcycles - old_data->taskinfos[j].kcycles; 132 132 133 pages_total += new_data->taskinfos[i].pages;133 mem_total += new_data->taskinfos[i].virt_mem; 134 134 ucycles_total += ucycles_diff[i]; 135 135 kcycles_total += kcycles_diff[i]; … … 139 139 new_data->task_perc = malloc(new_data->task_count * sizeof(task_perc_t)); 140 140 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; 142 142 new_data->task_perc[i].ucycles = (float)(ucycles_diff[i] * 100) / ucycles_total; 143 143 new_data->task_perc[i].kcycles = (float)(kcycles_diff[i] * 100) / kcycles_total;
Note:
See TracChangeset
for help on using the changeset viewer.