Changeset 7a3ccbc in mainline
- Timestamp:
- 2010-04-07T10:41:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a325832
- Parents:
- 36b5b0f
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ps/taskinfo.h
r36b5b0f r7a3ccbc 48 48 task_id_t taskid; 49 49 char name[TASK_NAME_BUFLEN]; 50 size_t pages;50 uint64_t virt_mem; 51 51 int thread_count; 52 52 uint64_t ucycles; -
kernel/generic/src/ps/ps.c
r36b5b0f r7a3ccbc 90 90 } 91 91 92 static size_t get_pages_count(as_t *as)92 static uint64_t get_task_memory(as_t *as) 93 93 { 94 94 mutex_lock(&as->lock); … … 115 115 mutex_unlock(&as->lock); 116 116 117 return result ;117 return result * PAGE_SIZE; 118 118 } 119 119 … … 144 144 copy_to_uspace(&uspace_info->kcycles, &kcycles, sizeof(uint64_t)); 145 145 146 size_t pages = get_pages_count(t->as);147 copy_to_uspace(&uspace_info-> pages, &pages, sizeof(pages));146 uint64_t memory = get_task_memory(t->as); 147 copy_to_uspace(&uspace_info->virt_mem, &memory, sizeof(memory)); 148 148 149 149 int thread_count = atomic_get(&t->refcount); -
uspace/app/ps/ps.c
r36b5b0f r7a3ccbc 76 76 } 77 77 78 printf(" ID Threads PagesuCycles kCycles Cycle fault Name\n");78 printf(" ID Threads Mem uCycles kCycles Cycle fault Name\n"); 79 79 80 80 int i; … … 82 82 task_info_t taskinfo; 83 83 get_task_info(tasks[i], &taskinfo); 84 uint64_t ucycles, kcycles; 85 char usuffix, ksuffix; 84 uint64_t mem, ucycles, kcycles; 85 char memsuffix, usuffix, ksuffix; 86 order(taskinfo.virt_mem, &mem, &memsuffix); 86 87 order(taskinfo.ucycles, &ucycles, &usuffix); 87 88 order(taskinfo.kcycles, &kcycles, &ksuffix); 88 printf("%8llu %8u %8 u%12llu%c %12llu%c %s\n", tasks[i],89 taskinfo.thread_count, taskinfo.pages, ucycles, usuffix,89 printf("%8llu %8u %8llu%c %12llu%c %12llu%c %s\n", tasks[i], 90 taskinfo.thread_count, mem, memsuffix, ucycles, usuffix, 90 91 kcycles, ksuffix, taskinfo.name); 91 92 } -
uspace/app/top/screen.c
r36b5b0f r7a3ccbc 155 155 return; 156 156 task_info_t *taskinfo = &data->taskinfos[i]; 157 printf("%8llu %8u %8u ", taskinfo->taskid, 158 taskinfo->thread_count, taskinfo->pages); 157 uint64_t mem; 158 char suffix; 159 order(taskinfo->virt_mem, &mem, &suffix); 160 printf("%8llu %8u %8llu%c ", taskinfo->taskid, 161 taskinfo->thread_count, mem, suffix); 159 162 task_perc_t *taskperc = &data->task_perc[i]; 160 163 puts(" "); 161 print_float(taskperc-> pages, 2);164 print_float(taskperc->mem, 2); 162 165 puts("% "); 163 166 print_float(taskperc->ucycles, 2); … … 173 176 fflush(stdout); 174 177 console_set_rgb_color(fphone(stdout), WHITE, BLACK); 175 printf(" ID Threads Pages %%Pages%%uCycles %%kCycles Name");178 printf(" ID Threads Mem %%Mem %%uCycles %%kCycles Name"); 176 179 int i; 177 180 for (i = 60; i < colls; ++i) -
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; -
uspace/app/top/top.h
r36b5b0f r7a3ccbc 46 46 float ucycles; 47 47 float kcycles; 48 float pages;48 float mem; 49 49 } task_perc_t; 50 50
Note:
See TracChangeset
for help on using the changeset viewer.