Changeset dec16a2 in mainline for uspace/lib/c/generic/stats.c
- Timestamp:
- 2010-04-18T16:52:47Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5c45ca8
- Parents:
- e535eeb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/stats.c
re535eeb rdec16a2 96 96 } 97 97 98 /** Get task IDs99 * 100 * @param count Number of IDs returned.101 * 102 * @return Array of IDs (task_id_t).103 * If non-NULL then it should be eventually freed 104 * by free(). 105 * 106 */ 107 task_id_t *stats_get_tasks(size_t *count)108 { 109 size_t size = 0; 110 task_id_t *ids =111 ( task_id_t *) sysinfo_get_data("system.tasks", &size);112 113 assert((size % sizeof( task_id_t)) == 0);114 115 *count = size / sizeof( task_id_t);116 return ids;98 /** Get task statistics 99 * 100 * @param count Number of records returned. 101 * 102 * @return Array of stats_task_t structures. 103 * If non-NULL then it should be eventually freed 104 * by free(). 105 * 106 */ 107 stats_task_t *stats_get_tasks(size_t *count) 108 { 109 size_t size = 0; 110 stats_task_t *stats_tasks = 111 (stats_task_t *) sysinfo_get_data("system.tasks", &size); 112 113 assert((size % sizeof(stats_task_t)) == 0); 114 115 *count = size / sizeof(stats_task_t); 116 return stats_tasks; 117 117 } 118 118 … … 140 140 } 141 141 142 /** Get thread IDs143 * 144 * @param count Number of IDs returned.145 * 146 * @return Array of IDs (thread_id_t).147 * If non-NULL then it should be eventually freed 148 * by free(). 149 * 150 */ 151 thread_id_t *stats_get_threads(size_t *count)152 { 153 size_t size = 0; 154 thread_id_t *ids =155 ( thread_id_t *) sysinfo_get_data("system.threads", &size);156 157 assert((size % sizeof( thread_id_t)) == 0);158 159 *count = size / sizeof( thread_id_t);160 return ids;142 /** Get thread statistics. 143 * 144 * @param count Number of records returned. 145 * 146 * @return Array of stats_thread_t structures. 147 * If non-NULL then it should be eventually freed 148 * by free(). 149 * 150 */ 151 stats_thread_t *stats_get_threads(size_t *count) 152 { 153 size_t size = 0; 154 stats_thread_t *stats_threads = 155 (stats_thread_t *) sysinfo_get_data("system.threads", &size); 156 157 assert((size % sizeof(stats_thread_t)) == 0); 158 159 *count = size / sizeof(stats_thread_t); 160 return stats_threads; 161 161 } 162 162
Note:
See TracChangeset
for help on using the changeset viewer.