Lines Matching refs:mtp
91 memstat_mtl_next(struct memory_type *mtp) in memstat_mtl_next() argument
94 return (LIST_NEXT(mtp, mt_list)); in memstat_mtl_next()
100 struct memory_type *mtp; in _memstat_mtl_empty() local
102 while ((mtp = LIST_FIRST(&list->mtl_list))) { in _memstat_mtl_empty()
103 free(mtp->mt_percpu_alloc); in _memstat_mtl_empty()
104 free(mtp->mt_percpu_cache); in _memstat_mtl_empty()
105 LIST_REMOVE(mtp, mt_list); in _memstat_mtl_empty()
106 free(mtp); in _memstat_mtl_empty()
134 struct memory_type *mtp; in memstat_mtl_find() local
136 LIST_FOREACH(mtp, &list->mtl_list, mt_list) { in memstat_mtl_find()
137 if ((mtp->mt_allocator == allocator || in memstat_mtl_find()
139 strcmp(mtp->mt_name, name) == 0) in memstat_mtl_find()
140 return (mtp); in memstat_mtl_find()
155 struct memory_type *mtp; in _memstat_mt_allocate() local
157 mtp = malloc(sizeof(*mtp)); in _memstat_mt_allocate()
158 if (mtp == NULL) in _memstat_mt_allocate()
161 bzero(mtp, sizeof(*mtp)); in _memstat_mt_allocate()
163 mtp->mt_allocator = allocator; in _memstat_mt_allocate()
164 mtp->mt_percpu_alloc = malloc(sizeof(struct mt_percpu_alloc_s) * in _memstat_mt_allocate()
166 mtp->mt_percpu_cache = malloc(sizeof(struct mt_percpu_cache_s) * in _memstat_mt_allocate()
168 strlcpy(mtp->mt_name, name, MEMTYPE_MAXNAME); in _memstat_mt_allocate()
169 LIST_INSERT_HEAD(&list->mtl_list, mtp, mt_list); in _memstat_mt_allocate()
170 return (mtp); in _memstat_mt_allocate()
181 _memstat_mt_reset_stats(struct memory_type *mtp, int maxcpus) in _memstat_mt_reset_stats() argument
185 mtp->mt_countlimit = 0; in _memstat_mt_reset_stats()
186 mtp->mt_byteslimit = 0; in _memstat_mt_reset_stats()
187 mtp->mt_sizemask = 0; in _memstat_mt_reset_stats()
188 mtp->mt_size = 0; in _memstat_mt_reset_stats()
190 mtp->mt_memalloced = 0; in _memstat_mt_reset_stats()
191 mtp->mt_memfreed = 0; in _memstat_mt_reset_stats()
192 mtp->mt_numallocs = 0; in _memstat_mt_reset_stats()
193 mtp->mt_numfrees = 0; in _memstat_mt_reset_stats()
194 mtp->mt_bytes = 0; in _memstat_mt_reset_stats()
195 mtp->mt_count = 0; in _memstat_mt_reset_stats()
196 mtp->mt_free = 0; in _memstat_mt_reset_stats()
197 mtp->mt_failures = 0; in _memstat_mt_reset_stats()
198 mtp->mt_sleeps = 0; in _memstat_mt_reset_stats()
200 mtp->mt_zonefree = 0; in _memstat_mt_reset_stats()
201 mtp->mt_kegfree = 0; in _memstat_mt_reset_stats()
204 mtp->mt_percpu_alloc[i].mtp_memalloced = 0; in _memstat_mt_reset_stats()
205 mtp->mt_percpu_alloc[i].mtp_memfreed = 0; in _memstat_mt_reset_stats()
206 mtp->mt_percpu_alloc[i].mtp_numallocs = 0; in _memstat_mt_reset_stats()
207 mtp->mt_percpu_alloc[i].mtp_numfrees = 0; in _memstat_mt_reset_stats()
208 mtp->mt_percpu_alloc[i].mtp_sizemask = 0; in _memstat_mt_reset_stats()
209 mtp->mt_percpu_cache[i].mtp_free = 0; in _memstat_mt_reset_stats()
218 memstat_get_name(const struct memory_type *mtp) in memstat_get_name() argument
221 return (mtp->mt_name); in memstat_get_name()
225 memstat_get_allocator(const struct memory_type *mtp) in memstat_get_allocator() argument
228 return (mtp->mt_allocator); in memstat_get_allocator()
232 memstat_get_countlimit(const struct memory_type *mtp) in memstat_get_countlimit() argument
235 return (mtp->mt_countlimit); in memstat_get_countlimit()
239 memstat_get_byteslimit(const struct memory_type *mtp) in memstat_get_byteslimit() argument
242 return (mtp->mt_byteslimit); in memstat_get_byteslimit()
246 memstat_get_sizemask(const struct memory_type *mtp) in memstat_get_sizemask() argument
249 return (mtp->mt_sizemask); in memstat_get_sizemask()
253 memstat_get_size(const struct memory_type *mtp) in memstat_get_size() argument
256 return (mtp->mt_size); in memstat_get_size()
260 memstat_get_rsize(const struct memory_type *mtp) in memstat_get_rsize() argument
263 return (mtp->mt_rsize); in memstat_get_rsize()
267 memstat_get_memalloced(const struct memory_type *mtp) in memstat_get_memalloced() argument
270 return (mtp->mt_memalloced); in memstat_get_memalloced()
274 memstat_get_memfreed(const struct memory_type *mtp) in memstat_get_memfreed() argument
277 return (mtp->mt_memfreed); in memstat_get_memfreed()
281 memstat_get_numallocs(const struct memory_type *mtp) in memstat_get_numallocs() argument
284 return (mtp->mt_numallocs); in memstat_get_numallocs()
288 memstat_get_numfrees(const struct memory_type *mtp) in memstat_get_numfrees() argument
291 return (mtp->mt_numfrees); in memstat_get_numfrees()
295 memstat_get_bytes(const struct memory_type *mtp) in memstat_get_bytes() argument
298 return (mtp->mt_bytes); in memstat_get_bytes()
302 memstat_get_count(const struct memory_type *mtp) in memstat_get_count() argument
305 return (mtp->mt_count); in memstat_get_count()
309 memstat_get_free(const struct memory_type *mtp) in memstat_get_free() argument
312 return (mtp->mt_free); in memstat_get_free()
316 memstat_get_failures(const struct memory_type *mtp) in memstat_get_failures() argument
319 return (mtp->mt_failures); in memstat_get_failures()
323 memstat_get_sleeps(const struct memory_type *mtp) in memstat_get_sleeps() argument
326 return (mtp->mt_sleeps); in memstat_get_sleeps()
330 memstat_get_xdomain(const struct memory_type *mtp) in memstat_get_xdomain() argument
333 return (mtp->mt_xdomain); in memstat_get_xdomain()
337 memstat_get_caller_pointer(const struct memory_type *mtp, int index) in memstat_get_caller_pointer() argument
340 return (mtp->mt_caller_pointer[index]); in memstat_get_caller_pointer()
344 memstat_set_caller_pointer(struct memory_type *mtp, int index, void *value) in memstat_set_caller_pointer() argument
347 mtp->mt_caller_pointer[index] = value; in memstat_set_caller_pointer()
351 memstat_get_caller_uint64(const struct memory_type *mtp, int index) in memstat_get_caller_uint64() argument
354 return (mtp->mt_caller_uint64[index]); in memstat_get_caller_uint64()
358 memstat_set_caller_uint64(struct memory_type *mtp, int index, uint64_t value) in memstat_set_caller_uint64() argument
361 mtp->mt_caller_uint64[index] = value; in memstat_set_caller_uint64()
365 memstat_get_zonefree(const struct memory_type *mtp) in memstat_get_zonefree() argument
368 return (mtp->mt_zonefree); in memstat_get_zonefree()
372 memstat_get_kegfree(const struct memory_type *mtp) in memstat_get_kegfree() argument
375 return (mtp->mt_kegfree); in memstat_get_kegfree()
379 memstat_get_percpu_memalloced(const struct memory_type *mtp, int cpu) in memstat_get_percpu_memalloced() argument
382 return (mtp->mt_percpu_alloc[cpu].mtp_memalloced); in memstat_get_percpu_memalloced()
386 memstat_get_percpu_memfreed(const struct memory_type *mtp, int cpu) in memstat_get_percpu_memfreed() argument
389 return (mtp->mt_percpu_alloc[cpu].mtp_memfreed); in memstat_get_percpu_memfreed()
393 memstat_get_percpu_numallocs(const struct memory_type *mtp, int cpu) in memstat_get_percpu_numallocs() argument
396 return (mtp->mt_percpu_alloc[cpu].mtp_numallocs); in memstat_get_percpu_numallocs()
400 memstat_get_percpu_numfrees(const struct memory_type *mtp, int cpu) in memstat_get_percpu_numfrees() argument
403 return (mtp->mt_percpu_alloc[cpu].mtp_numfrees); in memstat_get_percpu_numfrees()
407 memstat_get_percpu_sizemask(const struct memory_type *mtp, int cpu) in memstat_get_percpu_sizemask() argument
410 return (mtp->mt_percpu_alloc[cpu].mtp_sizemask); in memstat_get_percpu_sizemask()
414 memstat_get_percpu_caller_pointer(const struct memory_type *mtp, int cpu, in memstat_get_percpu_caller_pointer() argument
418 return (mtp->mt_percpu_alloc[cpu].mtp_caller_pointer[index]); in memstat_get_percpu_caller_pointer()
422 memstat_set_percpu_caller_pointer(struct memory_type *mtp, int cpu, in memstat_set_percpu_caller_pointer() argument
426 mtp->mt_percpu_alloc[cpu].mtp_caller_pointer[index] = value; in memstat_set_percpu_caller_pointer()
430 memstat_get_percpu_caller_uint64(const struct memory_type *mtp, int cpu, in memstat_get_percpu_caller_uint64() argument
434 return (mtp->mt_percpu_alloc[cpu].mtp_caller_uint64[index]); in memstat_get_percpu_caller_uint64()
438 memstat_set_percpu_caller_uint64(struct memory_type *mtp, int cpu, int index, in memstat_set_percpu_caller_uint64() argument
442 mtp->mt_percpu_alloc[cpu].mtp_caller_uint64[index] = value; in memstat_set_percpu_caller_uint64()
446 memstat_get_percpu_free(const struct memory_type *mtp, int cpu) in memstat_get_percpu_free() argument
449 return (mtp->mt_percpu_cache[cpu].mtp_free); in memstat_get_percpu_free()