Changeset c3d4bb45 in mainline
- Timestamp:
- 2010-04-18T11:59:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3d482e0
- Parents:
- 70e2b2d
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tasks/tasks.c
r70e2b2d rc3d4bb45 69 69 size_t count; 70 70 task_id_t *ids = 71 (task_id_t *) get_stats_tasks(&count);71 (task_id_t *) stats_get_tasks(&count); 72 72 73 73 if (ids == NULL) { … … 80 80 size_t i; 81 81 for (i = 0; i < count; i++) { 82 stats_task_t *stats_task = get_stats_task(ids[i]);82 stats_task_t *stats_task = stats_get_task(ids[i]); 83 83 if (stats_task != NULL) { 84 84 uint64_t virtmem, ucycles, kcycles; … … 142 142 { 143 143 size_t count; 144 load_t *load = get_stats_load(&count);144 load_t *load = stats_get_load(&count); 145 145 146 146 if (load == NULL) { … … 156 156 printf(" "); 157 157 158 print_load_fragment(load[i], 2);158 stats_print_load_fragment(load[i], 2); 159 159 } 160 160 … … 167 167 { 168 168 size_t count; 169 stats_cpu_t *cpus = get_stats_cpus(&count);169 stats_cpu_t *cpus = stats_get_cpus(&count); 170 170 171 171 if (cpus == NULL) { -
uspace/app/uptime/uptime.c
r70e2b2d rc3d4bb45 59 59 (sec % HOUR) / MINUTE, sec % MINUTE); 60 60 61 sysarg_t uptime = get_stats_uptime();61 sysarg_t uptime = stats_get_uptime(); 62 62 printf(", up %u days, %u hours, %u minutes, %u seconds", uptime / DAY, 63 63 (uptime % DAY) / HOUR, (uptime % HOUR) / MINUTE, uptime % MINUTE); 64 64 65 65 size_t count; 66 load_t *load = get_stats_load(&count);66 load_t *load = stats_get_load(&count); 67 67 if (load != NULL) { 68 68 printf(", load average: "); … … 73 73 printf(" "); 74 74 75 print_load_fragment(load[i], 2);75 stats_print_load_fragment(load[i], 2); 76 76 } 77 77 -
uspace/lib/c/generic/stats.c
r70e2b2d rc3d4bb45 52 52 * 53 53 */ 54 stats_cpu_t * get_stats_cpus(size_t *count)54 stats_cpu_t *stats_get_cpus(size_t *count) 55 55 { 56 56 size_t size = 0; … … 72 72 * 73 73 */ 74 stats_physmem_t * get_stats_physmem(void)74 stats_physmem_t *stats_get_physmem(void) 75 75 { 76 76 size_t size = 0; … … 92 92 * 93 93 */ 94 task_id_t * get_stats_tasks(size_t *count)94 task_id_t *stats_get_tasks(size_t *count) 95 95 { 96 96 size_t size = 0; … … 113 113 * 114 114 */ 115 stats_task_t * get_stats_task(task_id_t task_id)115 stats_task_t *stats_get_task(task_id_t task_id) 116 116 { 117 117 char name[SYSINFO_STATS_MAX_PATH]; … … 136 136 * 137 137 */ 138 load_t * get_stats_load(size_t *count)138 load_t *stats_get_load(size_t *count) 139 139 { 140 140 size_t size = 0; … … 153 153 * 154 154 */ 155 sysarg_t get_stats_uptime(void)155 sysarg_t stats_get_uptime(void) 156 156 { 157 157 sysarg_t uptime; … … 171 171 * 172 172 */ 173 void print_load_fragment(load_t upper, unsigned int dec_length)173 void stats_print_load_fragment(load_t upper, unsigned int dec_length) 174 174 { 175 175 /* Magic value from BSD */ -
uspace/lib/c/include/stats.h
r70e2b2d rc3d4bb45 39 39 #include <kernel/sysinfo/abi.h> 40 40 41 extern stats_cpu_t * get_stats_cpus(size_t *);42 extern stats_physmem_t * get_stats_physmem(void);43 extern task_id_t * get_stats_tasks(size_t *);44 extern stats_task_t * get_stats_task(task_id_t);45 extern load_t * get_stats_load(size_t *);46 extern sysarg_t get_stats_uptime(void);41 extern stats_cpu_t *stats_get_cpus(size_t *); 42 extern stats_physmem_t *stats_get_physmem(void); 43 extern task_id_t *stats_get_tasks(size_t *); 44 extern stats_task_t *stats_get_task(task_id_t); 45 extern load_t *stats_get_load(size_t *); 46 extern sysarg_t stats_get_uptime(void); 47 47 48 extern void print_load_fragment(load_t, unsigned int);48 extern void stats_print_load_fragment(load_t, unsigned int); 49 49 50 50 #endif
Note:
See TracChangeset
for help on using the changeset viewer.