Changes in uspace/lib/c/generic/stats.c [dec16a2:8eec3c8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/stats.c
rdec16a2 r8eec3c8 184 184 } 185 185 186 /** Get exception statistics. 187 * 188 * @param count Number of records returned. 189 * 190 * @return Array of stats_exc_t structures. 191 * If non-NULL then it should be eventually freed 192 * by free(). 193 * 194 */ 195 stats_exc_t *stats_get_exceptions(size_t *count) 196 { 197 size_t size = 0; 198 stats_exc_t *stats_exceptions = 199 (stats_exc_t *) sysinfo_get_data("system.exceptions", &size); 200 201 assert((size % sizeof(stats_exc_t)) == 0); 202 203 *count = size / sizeof(stats_exc_t); 204 return stats_exceptions; 205 } 206 207 /** Get single exception statistics 208 * 209 * @param excn Exception number we are interested in. 210 * 211 * @return Pointer to the stats_exc_t structure. 212 * If non-NULL then it should be eventually freed 213 * by free(). 214 * 215 */ 216 stats_exc_t *stats_get_exception(unsigned int excn) 217 { 218 char name[SYSINFO_STATS_MAX_PATH]; 219 snprintf(name, SYSINFO_STATS_MAX_PATH, "system.exceptionss.%u", excn); 220 221 size_t size = 0; 222 stats_exc_t *stats_exception = 223 (stats_exc_t *) sysinfo_get_data(name, &size); 224 225 assert((size == sizeof(stats_exc_t)) || (size == 0)); 226 227 return stats_exception; 228 } 229 186 230 /** Get system load 187 231 *
Note:
See TracChangeset
for help on using the changeset viewer.