Changeset 516adce in mainline
- Timestamp:
- 2010-04-07T10:24:00Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36b5b0f
- Parents:
- 1ba37fa
- Files:
-
- 5 added
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r1ba37fa r516adce 233 233 generic/src/ps/cpu.c \ 234 234 generic/src/ps/load.c \ 235 generic/src/ps/uptime.c 235 generic/src/ps/uptime.c \ 236 generic/src/ps/mem.c 236 237 237 238 ## Kernel console support -
kernel/generic/include/mm/frame.h
r1ba37fa r516adce 170 170 extern void zone_merge_all(void); 171 171 extern uint64_t zone_total_size(void); 172 extern void zone_busy_and_free(uint64_t *out_busy, uint64_t *out_free); 172 173 173 174 /* -
kernel/generic/include/ps/ps.h
r1ba37fa r516adce 38 38 #include <ps/taskinfo.h> 39 39 #include <ps/cpuinfo.h> 40 #include <ps/meminfo.h> 40 41 41 42 extern size_t sys_ps_get_tasks(task_id_t *uspace_ids, size_t size); … … 43 44 extern int sys_ps_get_threads(task_id_t *uspace_id, thread_info_t *uspace_infos, size_t size); 44 45 extern int sys_ps_get_cpu_info(uspace_cpu_info_t *uspace_cpu); 46 extern int sys_ps_get_mem_info(uspace_mem_info_t *mem_info); 45 47 46 48 #endif -
kernel/generic/include/syscall/syscall.h
r1ba37fa r516adce 89 89 90 90 SYS_PS_GET_CPU_INFO, 91 SYS_PS_GET_MEM_INFO, 91 92 SYS_PS_GET_TASKS, 92 93 SYS_PS_GET_TASK_INFO, -
kernel/generic/src/main/main.c
r1ba37fa r516adce 224 224 printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n", 225 225 config.cpu_count, SIZE2MB(zone_total_size())); 226 226 227 227 LOG_EXEC(cpu_init()); 228 228 -
kernel/generic/src/mm/frame.c
r1ba37fa r516adce 1218 1218 } 1219 1219 1220 void zone_busy_and_free(uint64_t *out_busy, uint64_t *out_free) 1221 { 1222 ipl_t ipl = interrupts_disable(); 1223 spinlock_lock(&zones.lock); 1224 1225 uint64_t busy = 0, free = 0; 1226 size_t i; 1227 for (i = 0; i < zones.count; i++) { 1228 bool available = zone_flags_available(zones.info[i].flags); 1229 /* Do not count reserved memory */ 1230 if (available) { 1231 busy += (uint64_t) FRAMES2SIZE(zones.info[i].busy_count); 1232 free += (uint64_t) FRAMES2SIZE(zones.info[i].free_count); 1233 } 1234 } 1235 1236 spinlock_unlock(&zones.lock); 1237 interrupts_restore(ipl); 1238 *out_busy = busy; 1239 *out_free = free; 1240 } 1241 1220 1242 /** Prints list of zones. */ 1221 1243 void zone_print_list(void) -
kernel/generic/src/syscall/syscall.c
r1ba37fa r516adce 171 171 /* Ps calls */ 172 172 (syshandler_t) sys_ps_get_cpu_info, 173 (syshandler_t) sys_ps_get_mem_info, 173 174 (syshandler_t) sys_ps_get_tasks, 174 175 (syshandler_t) sys_ps_get_task_info, -
uspace/app/top/Makefile
r1ba37fa r516adce 35 35 screen.c \ 36 36 input.c \ 37 func.c \ 37 38 ps.c 38 39 -
uspace/app/top/screen.c
r1ba37fa r516adce 43 43 #include "screen.h" 44 44 #include "top.h" 45 #include "func.h" 45 46 46 47 int rows; … … 133 134 ++up_rows; 134 135 } 136 } 137 138 static inline void print_meminfo(data_t *data) 139 { 140 uint64_t newsize; 141 char suffix; 142 order(data->mem_info.total, &newsize, &suffix); 143 printf("Mem: %8llu %c total", newsize, suffix); 144 order(data->mem_info.used, &newsize, &suffix); 145 printf(", %8llu %c used", newsize, suffix); 146 order(data->mem_info.free, &newsize, &suffix); 147 printf(", %8llu %c free", newsize, suffix); 135 148 } 136 149 … … 182 195 ++up_rows; 183 196 print_cpuinfo(data); 197 print_meminfo(data); 198 puts("\n"); 199 ++up_rows; 184 200 puts("\n"); 185 201 ++up_rows; -
uspace/app/top/top.c
r1ba37fa r516adce 43 43 #include <sys/time.h> 44 44 #include <load.h> 45 #include <ps.h> 45 46 #include "screen.h" 46 47 #include "input.h" … … 84 85 /* Read cpu infos */ 85 86 target->cpu_count = get_cpu_infos(&target->cpus); 87 88 /* Read mem info */ 89 get_mem_info(&target->mem_info); 86 90 } 87 91 -
uspace/app/top/top.h
r1ba37fa r516adce 68 68 uspace_cpu_info_t *cpus; 69 69 cpu_perc_t *cpu_perc; 70 71 uspace_mem_info_t mem_info; 70 72 } data_t; 71 73 -
uspace/lib/c/Makefile
r1ba37fa r516adce 92 92 generic/stacktrace.c \ 93 93 generic/ps.c \ 94 generic/cpu.c \ 94 generic/cpuinfo.c \ 95 generic/meminfo.c \ 95 96 generic/load.c \ 96 97 generic/uptime.c -
uspace/lib/c/include/ps.h
r1ba37fa r516adce 39 39 #include <kernel/ps/taskinfo.h> 40 40 #include <kernel/ps/cpuinfo.h> 41 #include <kernel/ps/meminfo.h> 41 42 42 43 extern int get_cpu_info(uspace_cpu_info_t *cpus); 44 extern int get_mem_info(uspace_mem_info_t *meminfo); 43 45 extern size_t get_task_ids(task_id_t *ids, size_t size); 44 46 extern int get_task_info(task_id_t id, task_info_t *info);
Note:
See TracChangeset
for help on using the changeset viewer.